I have a USB-stick which acts as my backup. As I program a lot compilation and unit testing produces a lot of trash (.pdb, Test Results, obj-files etc). I don’t want or need a backup of those.
Today I found a short script that removes those file. Since I have folders named “bin” I want to keep I tweaked it a bit into this:
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S Debug') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S _Resharper*') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S TestResults') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('dir /b /A /S *.vsmdi') DO RMDIR /S /Q "%%G"
I don’t know if you are like me and don’t know the first things of DOS. Well this script deletes the following:
- All Debug-folders (both obj/Debug and bin/Debug)
- All folders that Resharper generates for you
- All TestResults folder (they can be massive!!)
- All the crazy vsmdi-files that hold testlist for you
1 comment:
If you do it often make a it available on right click in explorer
Paste following in a *.reg file and change "Delete files" and paste command here.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Delete files]
@="Delete files"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Delete files\command]
@="paste command here"
Post a Comment