Saturday, January 22, 2011

How to Cleanup everything when Disk Cleanup doesn’t Delete Everything from the Temp Folder?

 

We all cleanup our computer time to time. It’s the bane of Windows. (NO such hassles in Linux, or so they say). The routing is Virus scan of whole disk, emptying the recycle bin, defragging and cleaning up the temp folder. But the problem is when we run the disk cleanup it leaves behind files. Yeah.. it doesn’t clean everything. Something is still left.

Why Doesn’t Disk Cleanup Delete All Files?

The applications that you’re running create temporary files, not to litter your hard drive, but to store files while the application is working on them—whether it’s downloading files, storing files that you’re currently editing, or just caching files so the next time you open the application the files will be more quickly accessible.

The problem is that most applications don’t seem to clean up after themselves, or if they do, they definitely don’t do it very well. That’s why your temporary folder gets really huge over time, and needs to be cleaned out.

Since these files are often being used by applications, Windows doesn’t know whether a particular file can be deleted, so Disk Cleanup only cleans up files that are older than 7 days, which is a safe guess—most people probably don’t have an application open for more than a week, especially since Microsoft makes you reboot nearly every Tuesday, right?

image

You can even see in the screenshot that Disk Cleanup explains this to you, if you select the Temporary files option in the list.

Change Disk Cleanup to Delete Files Newer than 7 Days

If you reboots your PC every day, you can  change the Disk Cleanup value down to 2 days. If you don’t reboot but you rarely keep applications open, you could probably do fine with 2-3 days instead, though the value you choose is really up to you—just keep in mind applications need those temporary files if they are running.

Open up regedit.exe through the Start Menu search or run box, and then browse down to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
   CurrentVersion\Explorer\VolumeCaches\Temporary Files

There, you’ll see the LastAccess value on the right-hand side, which contains a value that specifies the number of days, which you can change to whatever you’d like.

image

You can see the results of your changes, you can open up your temporary folder by entering the following into the Windows Explorer location bar:

%temp%

1

If you want, you can delete these files manually.

For Safety, always backup your registry before playing around with it.  With best of intention, it is always possible that something will go wrong.

No comments: