@echo off set mydd=%date:~8,2% set myyy=%date:~0,4% set mymm=%date:~5,2% set fileName=d:\wf\eSupply_work\%myyy%%mymm%%mydd% echo %filename% if exist %filename% rd %filename% /s /q if exist %filename%_sc rd %filename%_sc /s /q md %filename% xcopy D:\wf\eSupply\eSupply\Web\*.* %filename% /s del %filename%\web.config
rd %filename%\log /s /q md %filename%_sc xcopy D:\wf\eSupply\eSupply\*.* %filename%_sc /s pause
這個批處理文件的作用就是將編譯好的文件及源碼 copy到按日期編號的目錄中,刪除web.config,用于發布前的準備,及自動備份源碼。
原文:http://www.cnblogs.com/wonder223/p/3810556.html