Search code examples
.netvisual-studio-2010vbscriptbatch-fileprojects-and-solutions

Creating a Bat File to Clean The C#/.Net Project Folder


I'm using "CleanProject" for cleaning my project file( get rid of resharper, bin/debug files etc. )

But, it's not good because it's also deletes( #marked files );

-MyProjectName.sln
-MyProjectName/Properties/
-MyProjectName/obj/
-MyProjectName/bin/
-MyProjectName/MyClass/Class1.cs
-MyProjectName/MyClass/DeveloperNotes.txt  //# < CleanProject deletes the DeveloperNotes.txt

So, here is my question; Can you point me an external software/batch/vbs file which I can easly edit for my needs. A .bat - batch file will be very good because I can easly customize it. Also, I saw them in john carmack's project(Doom 3 source codes). It can be very usefull if you know how to work with it.

Thanks,


Solution

  • If you want to use batch files, look up the FOR .. DO syntax. For example:

    REM CLEANPROJECT.BAT
    FOR /F %%F IN ('DIR /B *.dll') DO DEL %%F
    FOR /F %%F IN ('DIR /B *.pdb') DO DEL %%F