清理Visual Studio解决方案临时文件:Clean Visual Studio Solution Temporary File Build20160418

复制保存到任意文件名.bat,放置在Visual Studio Solution目录下。

当Visual Studio Solution目录过于庞大或打算拷贝移动Visual Studio Solution时,双击打开bat文件即可。

本bat文件仅删除Visual Studio每次运行自动创建的临时缓存文件,不会删除源文件,请放心使用。

 1 ::请勿轻易修改此文件,以避免不可预知的错误 By gwsbhqt@163.com
 2 
 3 @echo off
 4 color 0A
 5 title Clean Visual Studio Solution Temporary File     Build20160418
 6 
 7 if not exist *.sln (color 0C & echo 当前目录不存在Visual Studio解决方案... & ping 0 /n 3 >nul 2>nul & exit)
 8 
 9 echo 清理Visual Studio解决方案临时文件... & echo.  & echo 按任意键继续... & pause > nul
10 
11 attrib -a -r -s -h *.* >nul 2>nul
12 for /d %%i in (*) do (attrib -a -r -s -h %%i*.* >nul 2>nul)
13 
14 del /s /q /f *.sdf >nul 2>nul
15 del /s /q /f *.opendb >nul 2>nul
16 del /s /q /f *.suo >nul 2>nul
17 del /s /q /f *.aps >nul 2>nul
18 del /s /q /f *.exe >nul 2>nul
19 del /s /q /f *.ilk >nul 2>nul
20 del /s /q /f *.pdb >nul 2>nul
21 del /s /q /f *.iobj >nul 2>nul
22 del /s /q /f *.ipdb >nul 2>nul
23 del /s /q /f *.log >nul 2>nul
24 del /s /q /f *.obj >nul 2>nul
25 del /s /q /f *.pch >nul 2>nul
26 del /s /q /f *.res >nul 2>nul
27 del /s /q /f *.idb >nul 2>nul
28 del /s /q /f *.lastbuildstate >nul 2>nul
29 del /s /q /f *.tlog >nul 2>nul
30 
31 rd /s /q .vs >nul 2>nul
32 rd /s /q Debug >nul 2>nul
33 rd /s /q Release >nul 2>nul
34 rd /s /q ipch >nul 2>nul
35 rd /s /q x64 >nul 2>nul
36 
37 for /d %%i in (*) do (
38 rd /s /q %%iDebug >nul 2>nul
39 rd /s /q %%iRelease >nul 2>nul
40 rd /s /q %%ix64 >nul 2>nul
41 )
42 
43 cls & echo 清理完成... & ping 0 /n 2 >nul 2>nul
View Code
原文地址:https://www.cnblogs.com/gwsbhqt/p/5402935.html