bat script batch - file/folder manipulation

content

create folder -md

rename file (folder) -ren

copy file -xcopy

delete file -del


create folder -md

Create a single folder:

 Create multiple folders:

 Create a folder with a space in the folder name:

 Create a multilevel directory folder:

 Create a folder in the specified directory:

Create multiple folders by specifying a directory:

 

rename file (folder) -ren

Rename the specified folder in the current directory:

 Rename the specified directory folder:

 Rename the file:

Change all txt files starting with a in the current directory to bat files with the same name

 

 Change all files in the current directory named bat with three characters at the beginning of a to txt files

 

copy file -xcopy

Copy all files and folders (including files in the folder) in the G:\keshan\testbat\a directory to G:\keshan\testbat\b

/y means to directly overwrite if it already exists

delete file -del

Delete the specified file without confirmation:

To delete all files (excluding folders) in the specified level directory, you need to manually confirm [Y/N]:

 Delete all files (excluding folders) in the specified level directory without manual confirmation: [Add /q]

 Delete all levels of files in the directory, do not delete folders, you need to confirm each folder

Guess you like

Origin blog.csdn.net/qq_40323256/article/details/123971894