1. Copying files
Copy Cd.dll%windir%\system32
2. Copying folders
/s copies directories and subdirectories, except for empty.
/e copies directories and subdirectories, including empty.
xcopy%dir%\template/e%desdir%\bin\template
3. Create a Folder
" %desdir%\main "
4. Delete a folder
The/s parameter indicates that the folder and its following subdirectories and files are deleted
The/q parameter indicates that no confirmation is required
RD/S/D E:\soft
5. Naming folders based on time
Set " ymd=%date:~,4%%date:~5,2%%date:~8,2% " Set desdir=e:\test_%ymd%
The build folder name is: test_20160606
6. Generate file files and write content
@echo. >%desdir%-dfile.encoding=utf-8 -cp. /test-1.0-snapshot.jar Test.client.host.server>%desdir%\service\bin\startup.bat
Startup.bat will be generated and will be Java-dfile.encoding=utf-8-CP. /test-1.0-snapshot.jar Test.client.host.Server written to the bat file
7. Get Input variables
set dir=%1%
If the input command is Start.bat E:\soft then the dir value is E:\soft
BAT Command Summary