How to Force Disk Cleanup to Delete All Temporary Files
When you use the Disk Cleanup wizard in Windows it only deletes temporary files that are more than seven days old. By altering the LastAccess value in the registry, you can configure the Disk Cleanup utility to delete all the temporary files in the Temp folder regardless of the last accessed date. Here's how:
1. Open the Registry Editor by pressing Win + R keys to open a Run box. Type in regedit and click OK button.
2. Navigate to following registry key:
3. Locate and double-click the LastAccess value.
4. Double-click on the LastAccess value and change the Value Data setting from 7 to 0 and click OK.
5. To complete the operation, close the Registry Editor and restart your computer.
Changing the value to zero (0) will force the Disk Cleanup wizard to delete all the temporary files in the Temp folder every time you select the Temporary Files check box from Disk Cleanup wizard.
1. Open the Registry Editor by pressing Win + R keys to open a Run box. Type in regedit and click OK button.
2. Navigate to following registry key:
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files
3. Locate and double-click the LastAccess value.
4. Double-click on the LastAccess value and change the Value Data setting from 7 to 0 and click OK.
5. To complete the operation, close the Registry Editor and restart your computer.
Changing the value to zero (0) will force the Disk Cleanup wizard to delete all the temporary files in the Temp folder every time you select the Temporary Files check box from Disk Cleanup wizard.