2.1.1 basic batch command xcopy move del md
Automatic backup of the application of Windows command line batcmd script remote backup of tourist flag, introduction of Mo (Sun Zhong)
2.1.1 basic batch command xcopy move del md
Automatic backup of the application of Windows command line batcmd script remote backup
Course address: http://edu.51cto.com/course/15056.html
Windows Command Line bat/cmd batch script Writing Application File Management Application
Related tutorial: http://edu.51cto.com/course/11343.html
Command: xcopy
Parameter: / y if there is a duplicate name, overwrite it directly and do not prompt
/ s copy non-empty directories and subdirectories
/ e copy files and subdirectories, including empty directories
/ d if there is a duplicate name, compare the retention time with the new one
Usage: xcopy [parameter] [source path] [destination path]
For example: copy the files in folder A to folder B.
Xcopy / y "A*"B\"
Command: move
Usage: move [source path] [destination path]
Example: move the files in folder A to folder B.
Move "A *"B\"
Move folder A to folder B
Command: del
Parameter: / S Delete files including subfolders
Delete / Q directly, don't prompt
Usage: del [parameter] [source path] [destination path]
For example: delete all the contents of folder A, including files under subfolders.
Del / s / Q "A\"
Command: rd
Parameter: / S delete includes subfolders
Delete / Q directly, don't prompt
For example: delete folder An and subfolders
Rd / s / Q "A\"
Command: md
Usage: md [folder name]
Example: create a folder named "date"
Md date
Parameter: system date: date
System time: time
Example: create a folder named by date and time
Set "backname=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%"
Md backname%