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 relevant to say, you can leave a , or contact me directly.

About the author

Ivan's mugshotI'm Ivan Lutrov and I'm the owner of Lutrov Interactive. I have 25 years of experience producing interactive work and I create cost effective business websites that are simple, engaging and easy to use. I practice what I preach and I say what I really think, even if it's sometimes not what you want to hear. Subscribe to the Lutrov Interactive feed via RSS and follow me on Twitter.