Thursday, October 30, 2008

Deleting Temp Files

Copy down the command lines below and save it as a batch file.
It should clean your pc of temporary files. This includes caches and cookies.
It is especially useful if you are facing low virtual memory.
Not much but it does help a little.


@echo off
echo cleaning in progress
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo it is done!
echo. & pause

4 comments:

Anonymous said...

maybe u should explain what's a batch file.

Chun said...

Use notepad. save as *.bat.
That's all.

Owen Choo said...

How about where to store the .bat file and how to execute it?

Chun said...

Guess i thought everyone know what is a batch file. Sorry.

You can put it anywhere you like. When you think that your pc is slowing down or there is a warning that Virtual Memory is too low. That IS the time for you to double-click on the file.