Make Windows Disk Cleanup Work Better

toggle-button

Windows systems and programs create and use a lot of temporary files. Unfortunately, Windows is not always a good housekeeper and lets these “temporary” files accumulate. You might be surprised at how much stuff your system picks up over time. Some PC users may prefer to use a program like CCleaner to keep things neat but there is something to be said for keeping the system simple and using the built-in Windows accessory Disk Cleanup.

Windows Disk Cleanup of temporary files can be improved with a configuration change. A previous tip showed how to speed up Disk Cleanup in Windows XP and this tip will show how to make Disk Cleanup more thorough in all versions of Windows.

By default, Disk Cleanup only erases temporary files that are older than 7 days. If you do not want files left behind for that long, this setting can be changed to a shorter time with a Registry edit. (Before doing any Registry editing, be sure you understand what is involved. For example, see this tutorial.)  

Editing the Registry to reduce time temp files are kept

Open the Registry editor and go the key:

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

  1. In the right pane, right-click the entry “LastAccess”
  2. Choose “Modify”
  3. A dialog box similar to the figure below will open
  4. Enter a new value, such as 2, which will set the number of days that temp files are kept
  5. Click “OK”
  6. New value will take effect after a reboot

Modify Registry value

Registry file for painless Registry editing

If editing the Registry manually does not appeal to you, I have uploaded a Registry file that will do the job for you. Go to this page to download a zipped REG file. This particular file will reduce the time that temp files are kept to two days.  It can be used for Windows XP/Vista/7. Be sure to back up your Registry before applying any changes.

More information about Disk Cleanup

I have discussed Disk Cleanup for Windows XP in some detail at this link. A related discussion for Windows Vista/7 is given at this link.

Using the command line

The command line can be also used for a quick cleanup of temp files. See the following companion tip.

Get your own favorite tip published!  Know a neat tech tip or trick?  Then why not have it published here and receive full credit?  Click here to tell us your tip.


This tips section is maintained by Vic Laurie. Vic runs a Windows blog called The PC Informant and also operates a computer education website.

Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.

Please rate this article: 

Your rating: None
4.53846
Average: 4.5 (26 votes)