DOS命令mysql
新增用戶:nginx
@echo offsql
net user username "password" /addide
pause進程
刪除用戶:ip
@echo offit
net user username /delclass
pause軟件
設置用戶爲管理員:date
@echo off
net localgroup administrators username /add
pause
設置用戶爲非管理員:
@echo off
net localgroup administrators username /del
更改用戶名:
@echo off
echo 當前用戶名:%USERNAME%
set /p user=請輸入要更改的用戶名:
set /p newuser=請輸入新的用戶名稱 :
wmic useraccount where name='%user%' call Rename %newuser%
pause
更改用戶密碼:
@echo off
net user username password
pause
清空用戶密碼:
@echo off
net user username ""
pause
註銷系統:
@echo off
shutdown /l
定時關機:
@echo off
shutdown -s -t 300
取消定時設置:
@echo off
shutdown -a
重啓系統:
@echo off
shutdown -r
查看本機系統進程:
@echo off
tasklist
pause
查看遠程系統進程:
@echo off
tasklist /s ipaddress /u username /p password
pause
終止程序進程:
@echo off
taskkill /f /im "process name"
pause
7z壓縮:
@echo off
7z a E:\archive.zip E:\*.txt
pause
7z解壓縮:
@echo off
7z x E:\archive.zip -oE:\
pause
注:7-zip功能很強大,安裝軟件後,須要把安裝目錄下的7z.exe以及7z.dll文件copy到C:\Windows\System32目錄下;
新建文件夾:
@echo off
set nginxbackupdir=D:\backup\nginx
md %nginxbackupdir%\%date:-=%
md D:\backup\folder
pause
刪除文件夾:
@echo off
rd /s /q D:\backup\folder
pause
備份資料:
@echo off
xcopy /y /s /e d:\mysql d:\backup\mysql
pause