none
deleting temporary files in Windows 10 RRS feed

  • Question

  • I am using Windows 10 and cannot delete some temporary files.  Disk cleanup and deleting Internet History do not touch them.  What can I do
    Thursday, September 24, 2015 8:21 AM

All replies

  • Have you tried using disk cleanup but with the system files option ?

    Additionally you can try this script:

    @ECHO OFF
    REM Enable components to cleanup
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameStatisticsFiles" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameUpdateFiles" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Service Pack Cleanup" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Sync Files" /V StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Upgrade Discarded Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Archive Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Queue Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Archive Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Queue Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows ESD installation files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Upgrade Log Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
    
    REM Run cleanup
    IF EXIST %SystemRoot%\SYSTEM32\cleanmgr.exe START /WAIT cleanmgr /sagerun:100
    
    Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

    • Proposed as answer by Misuleinen Friday, September 25, 2015 8:11 AM
    Thursday, September 24, 2015 8:28 AM
  • As far as I can tell Windows 10 does not allow disk cleanup with System Files option.  If it does I cannot find it.  I  also do not know how to use the script provided.

    charlieb231

    Saturday, September 26, 2015 6:09 AM
  • After my first reply I found the System Files option.  Sadly, did not touch the files I am trying to delete.


    charlieb231

    • Proposed as answer by John Katrales Wednesday, March 29, 2017 4:02 AM
    Saturday, September 26, 2015 6:55 AM
  • here is the folder C:\Users\"Your name"\AppData\Local\Temp

    Tuesday, January 26, 2016 1:11 AM
  • I have the same problem & the folder you point to is empty but, I have almost 1 gig of files in temporary files.
    Wednesday, June 21, 2017 4:14 PM
  • Did you get an answer?
    Thursday, June 29, 2017 4:10 AM
  • Windows 10 (and even Windows 7) protects %windir%\Temp. Running Disk Cleanup without having permission will not delete those files. If you are logged in as an Administrator type account, you can grant yourself access. To get access and delete the Temp files:

    1. Close all open app Windows
    2. Open File Explorer
    3. Go to %windir% (normally C:\Windows)
    4. Highlight the Temp folder.
      A security warning pops up and tells you that you do not have permission to view the folder.
    5. Give yourself permission to the Windows Temp folder.
    6. You can now delete those tons of temp files left behind by poorly-coded programs that fail to clean up after themselves. If a file is in use, the system will not let it be deleted.

    I use a batch program (that I have not converted to PowerShell yet) to delete my Temporary Internet Files, Local\Temp files and %windir%\Temp files. It's very helpful.

    While Disk Cleanup offers a "Clean up system files" option (requiring Admin account credentials), I prefer the more straight-forward approach above.

    • Proposed as answer by Drazy Saturday, October 21, 2017 8:48 AM
    Wednesday, July 5, 2017 3:42 PM
  • Thank you soooooooooo much for this information. I have been trying to clear almost 5 gigs of temporary files from my disk for almost 6 months. Ive deleted things I needed trying to make space. You are a lifesaver.
    Friday, October 20, 2017 3:46 PM
  • Cool but I'm not totally sure Win 7 locks the "temp" folder by default...
    Saturday, October 21, 2017 8:56 AM
  • THANK YOU FOR THE INFORMATION. IT WORKED FOR ME.

    Sunday, October 22, 2017 11:28 AM
  • i opened file explorer options - there is NO option to enter ANY information - thanks for nothing
    Monday, December 18, 2017 4:43 PM
  • Hello charlieb231 to run the above command highlight and copy the above script then open an elecvated command prompt (run as administrator) and paste it inside the command box then hit enter. (Usually after copying the script once you have the command box open all you have to do is click inside the box and it will paste it automatically.) ....hope this helps
    Tuesday, January 9, 2018 7:55 PM
  • Sure makes me want a Apple computer
    Friday, September 14, 2018 6:19 PM
  • Trust me. You don't want a Mac!!
    Sunday, December 22, 2019 11:00 PM