有《windows核心编程》的朋友可能一般都会用到其代码库中一个清除冗余文件和文件夹的一个批处理:Clean.bat
它实在是太方便了,在工作中可以经常用它来清除那些生成的x64、Debug、Release文件夹和Bin、Obj文件,只留下我们需要的干净代码。
@echo Off
del /s /a *.txt *.exe *.suo *.ncb *.user *.dll *.pdb *.netmodule *.aps *.ilk 2>nul
FOR /R . %%d IN (.) DO rd /s /q "%%d/x64" 2>nul
FOR /R . %%d IN (.) DO rd /s /q "%%d/Debug" 2>nul
FOR /R . %%d IN (.) DO rd /s /q "%%d/Release" 2>nul
FOR /R . %%d IN (.) DO rd /s /q "%%d/Bin" 2>nul
FOR /R . %%d IN (.) DO rd /s /q "%%d/Obj" 2>nul
rem If the Properties directory is empty, remove it
FOR /R . %%d in (.) do rd /q "%%d/Properties" 2> nul