Skip to content

Instantly share code, notes, and snippets.

@simon987
Created October 28, 2018 17:28
Show Gist options
  • Save simon987/0e0c51b5ca17b63a951756a85a520d29 to your computer and use it in GitHub Desktop.
Save simon987/0e0c51b5ca17b63a951756a85a520d29 to your computer and use it in GitHub Desktop.
Delete temporary files (Windows)
@echo off
cls
del /F /S /Q "%systemroot%\temp\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\History\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Low\Content.IE5\*.*"
del /F /S /Q "C:\Users\%UserName%\AppData\Local\Temp\*.*"
del /F /S /Q "C:\Temp\*.*"
del /F /S /Q "C:\Users\%UserName%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\*.*
del /F /S /Q "C:\Users\%UserName%\AppData\Local\Microsoft\Windows\History\*.*
::Rem: No need to duplicate the following section for each registered User
del /F /S /Q "%homepath%\Cookies\*.*"
del /F /S /Q "%homepath%\recent\*.*"
del /F /S /Q "%homepath%\Local Settings\cookies\*.*"
del /F /S /Q "%homepath%\Local Settings\History\*.*"
del /F /S /Q "%homepath%\Local Settings\Temp\*.*"
del /F /S /Q "%homepath%\Local Settings\Temporary Internet Files\Content.IE5\*.*"
del /F /S /Q "C:\$Recycle.Bin.Bin\*.*"
del /F /S /Q "C:\Recycled\*.*"
del /F /S /Q %TEMP%\*.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment