Quick disk cleanup

Every few months, I like to do a little spring cleaning and remove the hundreds of temporary and backup files which get left behind by various applications.

While there are a number of tools which can tidy up your hard disk using the Windows XP/2000 graphical interface, sometimes a simple batch file is all you need:

del "%systemdrive%\*.bak" /s /q
del "%systemdrive%\*.tmp" /s /q
if exist "%systemdrive%\temp\" del "%systemdrive%\temp\*.*" /s /q
if exist "%systemroot%\temp\" del "%systemroot%\temp\*.*" /s /q 
del "%userprofile%\local settings\temp\*.*" /s /q

Copy and paste the above five lines into your favourite text editor and save the contents to your desktop. Just make sure the file extension is either ".cmd" or ".bat". Something like "Cleanup.cmd" is probably a good name.

Keep in mind that deleting files this way actually deletes the files permanently instead of putting them in your recycle bin.

Due to the large volume of spam, comments are disabled. If you have anything to say, please feel free to contact me directly.

About the author

Ivan's mugshotIvan Lutrov is the owner of Lutrov Interactive. He creates cost effective business websites that are simple, engaging and very easy to use. When not busy working on client and personal projects, he's into photography, fishing, cricket, tennis, music from the 70s, cooking, good wine, and apparently knows "way too much" about movies. He tells it like it is, whether you like it or not. Subscribe to the Lutrov Interactive feed via RSS and follow Ivan on Twitter.