Thursday, November 03, 2011

Temporary Files Deleter

Ok, here is a very simple temporary file deleter. It uses the most common places that the system keeps temp files and deletes specific types. Feel Free to edit it to include other places as well. So as normal copy and paste into a notepad file and save as a .bat

@echo off
cd\
:: User temp files
del "%TEMP%\*" /F /S /Q

:: System temp cache
del "%WINDIR%\TEMP\*" /F /S /Q

:: User history and temp files
del "%SystemDrive%%HOMEPATH%\Recent\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Temp\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Temporary Internet Files\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Application Data\ApplicationHistory\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\My Documents\*.tmp"
del "%SystemDrive%%HOMEPATH%\My Documents\*.bak"
del "%SystemDrive%%HOMEPATH%\My Documents\*.log"

:: complete
exit

No comments: