Home > Tech, Windows > Clear your temp files out quickly

Clear your temp files out quickly

November 11, 2010 Leave a comment Go to comments

I’m posting this primarily so I don’t forget it, but this is a quick and simple batch script that will recursively (and without stopping on locked files!) clean out the system temp directory, and the temp directory of the user that is running it.

REM ClrTmp.bat

@echo off
del "%TEMP%\*.*" /s /f /q
for /d %%d in (%TEMP%\*) do rmdir "%%d" /s /q

del "%WINDIR%\TEMP\*.*" /s /f /q
for /d %%d in (%WINDIR%\TEMP\*) do rmdir "%%d" /s /q
Advertisements
Categories: Tech, Windows
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s