.NET development can be brutal on a system; particularly web development. I created a simple batch file that (when run as admin) cleans up a lot of the temp directories that Visual Studio likes to fill up.
- Copy and paste the code below into a batch file (filename.bat).
- Temp directories may vary depending on OS.
- Update the framework version to the correct version(s) you’re using.
- Save the file.
- Right-click and Run as Admin.
@REM Restart local IIS.Start iisreset
@REM Delete everything from user local temp directory and localhost temp directories.
del /q "C:\Users\%username%\AppData\Local\Temp\*"FOR /D %%p IN ("C:\Users\%username%\AppData\Local\Temp\*.*") DO rmdir "%%p" /s /q
@REM Delete based on version(s) of .NETdel /q "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*" FOR /D %%p IN ("C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*.*") DO rmdir "%%p" /s /q
pause