Reg Fix to delete Temp Files

Several years ago I posted a reg fix to disable the “Compress old files” section of Disk Cleanup.
http://msmvps.com/blogs/kwsupport/archive/2005/01/09/31149.aspx


Here’s an additional reg fix for Disk Cleanup that makes sure that all temp files in the Temp folder are deleted. By default only temp files older than sever (7) days are deleted. By altering the LastAccess value in the registry, you can configure the Disk Cleanup utility to delete all the files in the Temp folder regardless of the last accessed date. Here’s how:



  1. Launch the Registry Editor (Regedit.exe).
  2. Go to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
    Explorer\VolumeCaches\Temporary Files

  3. Locate and double-click the LastAccess value.
  4. When you see the Edit DWORD Value dialog box, change the Value Data setting from 7 to 0 and click OK.
  5. To complete the operation, close the Registry Editor and restart Windows XP.

Changing the value to 0 will force the Disk Cleanup utility to delete all the files in the Temp folder every time that you select the Temporary Files check box.


 P.S. As always, making changes to the registry …. blah, blah, blah … You’re on your own!

One thought on “Reg Fix to delete Temp Files

  1. Tweak_DiskCleanup.reg

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders]
    “StateFlags”=dword:1
    ;”LastAccess”=hex:02,00,00,00
    ;”FileList”=”*.tmp”
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Compress old files]
    “StateFlags”=dword:1
    “Days”=dword:1f4 ;500days
    ;Compressing old unnused files is a gamble not worth
    ;risking. Old files may become frequently used again!
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Content Indexer Cleaner]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files]
    “StateFlags”=dword:1
    “LastAccess”=dword:0 ;Def=1e
    ;”FileList”=”*.dmp”
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Files]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files]
    “StateFlags”=dword:1
    ;”FileList”=”*.CHK”
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Remote Desktop Cache Files]
    “StateFlags”=dword:1
    “LastAccess”=dword:3 ;Def=7
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files]
    “StateFlags”=dword:1
    “LastAccess”=dword:1 ;Def=1e=30days
    ;”FileList”=”setup*.log|setup*.old|setuplog.txt|winnt32.log”
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System Restore]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Säkerhetskopierad avbildning för avinstallation]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files]
    “StateFlags”=dword:1
    “LastAccess”=dword:2 ;Def=7days old
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Offline Files]
    “StateFlags”=dword:1
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\WebClient and WebPublisher Cache]
    “StateFlags”=dword:1

Leave a Reply

Your email address will not be published. Required fields are marked *