以下为.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 暂停