以下爲.bat文件的代碼
參考清除VS2010工程不需要的文件_u013719984的博客-CSDN博客
echo 正在清理VS2015工程中不需要的文件
echo 開始清理請稍等......
@echo off
rem 清理
attrib -s -h -r *opendb
del /s /q *.opendb
del /s /q *.db
del /s /q .\ipch\*.*
rd /s /q .\ipch\
del /s /q .\Debug\*.*
rd /s /q .\Debug\
del /s /q .\Release\*.*
rd /s /q .\Release\
for %%p in ("%cd%") do set folder=%%~nxp
echo %folder%
del /s /q .\%folder%\Debug\*.*
rd /s /q .\%folder%\Debug\
del /s /q .\%folder%\Release\*.*
rd /s /q .\%folder%\Release\
解說
:: 註釋內容(第一個冒號後也可以跟任何一個非字母數字的字符)
rem 註釋內容(不能出現重定向符號和管道符號)
echo 註釋內容(不能出現重定向符號和管道符號)〉nul
del 刪除文件,rd刪除文件夾;
/S 除目錄本身外,還將刪除指定目錄下的所有子目錄和文件。用於刪除目錄樹。
/Q 安靜模式,帶 /S 刪除目錄樹時不要求確認
attrib 去掉 ”系統”、“只讀”、“隱藏” 這些屬性
pause 暫停