DOS command
New users:
@echo off
NET user username "password"/add
Pause
To delete a user:
@echo off
NET user Username/del
Pause
To set the user as an administrator:
@echo off
net localgroup Administrators Username/add
Pause
To set the user as non-administrator:
@echo off
net localgroup Administrators Username/del
change user name:
@echo off
Echo Current user name:%USERNAME%
set/p user= Please enter the user name you want to change:
set/p newuser= Please enter a new user name:
WMIC useraccount where name= '%user% ' call Rename%newuser%
Pause
change user password:
@echo off
NET user username password
Pause
Clear User password:
@echo off
NET user username ""
Pause
Logout system:
@echo off
shutdown/l
Timer shutdown:
@echo off
Shutdown-s-T 300
To cancel a timer setting:
@echo off
Shutdown-a
Restart the system:
@echo off
Shutdown-r
To view native system processes:
@echo off
Tasklist
Pause
To view remote system processes:
@echo off
tasklist/s ipaddress/u username/p Password
Pause
To terminate a program process:
@echo off
taskkill/f/im "Process name"
Pause
7z Compression:
@echo off
7z a E:\archive.zip e:\*.txt
Pause
7z Decompression:
@echo off
7z x e:\archive.zip-oe:\
Pause
Note: 7-zip function is very powerful, after installing the software, it is necessary to copy the 7z.exe and 7z.dll files under the installation directory to the C:\Windows\System32 directory;
New folder:
@echo off
Set Nginxbackupdir=d:\backup\nginx
MD%nginxbackupdir%\%date:-=%
MD D:\backup\folder
Pause
To delete a folder:
@echo off
RD/S/q D:\backup\folder
Pause
Backup data:
@echo off
xcopy/y/s/e D:\mysql D:\backup\mysql
Pause
This article is from the "Square Hill" blog, please be sure to keep this source http://63638790.blog.51cto.com/513514/1672750
DOS Common commands