If you’re anything like me, you probably have at least one (if not two or three) ‘temp’ directories scattered throughout your hard drive.  These directories were surely created with the best of intentions (‘OK, this temp directory is really going to be for temporary files.  I promise!’), but unless you’re incredibly religious about it, by now each one is filled with its own collection of random downloads, files, pictures, and other assorted junk.  To make things worse, you don’t feel safe deleting any of it, because well, you can’t remember why you put it there in the first place.

Fed up with never really knowing what files were temporary and therefore safe to delete in my collection of ‘temp’ directories, I finally came up with a simple solution that works for me.  I thought I’d share it here in the hopes that someone else might find it useful.

Steps:

  1. Create a directory named ‘SafeToDelete’ somewhere on your hard drive.  (I like to use C:\SafeToDelete)
  2. Create a batch file to delete the directory (and it’s contents) and recreate it.  (I named mine SafeToDelete.bat and put it in C:\)
  3. Schedule the batch file to either run daily or at boot-up

That’s it.  The batch file I use for step 2 consists of two lines:

rmdir SafeToDelete /s /q
mkdir SafeToDelete

And, I just use the built-in windows scheduler for step 3.  This way, when I’m saving files, I have to make a conscious decision, “Is this really a temporary file?”. If so, throw it in SafeToDelete knowing that it will get deleted soon.  If not, put it in its rightful place.

Hope that helps.  This method has certainly made my hard drive much cleaner.