Tips Tricks

How to Automatically Clear Windows Cache when Shutdown

Works on all Windows version

Clear Windows cache can indeed be one option that could be taken when wanting to restore almost full storage space. This cache is a temporary file that is commonly used by systems and programs that are running.

To delete temporary files, you can use the Disk Cleanup tool. But if you feel it is quite troublesome, then you can make the process automatically.

Automatically Clear Windows Cache when Shutdown

Unfortunately, there are no settings where you can clear the Windows cache automatically. Therefore, you need to utilize scripts that are executed automatically when Windows shuts down. We test this using Windows 10 Pro.

  1. Open Notepad.
  2. Copy-paste the script below into Notepad.
Del /S /F /Q %temp%
Del /S /F /Q %Windir%\Temp
Clear Windows Cache Code
  1. Save with any name but end in .bat (batch). For example deltemp.bat.
How to Automatically Clear Windows Cache when Shutdown 1
  1. Open the Group Policy Editor.
  2. Navigate to Computer Configuration > Windows Settings > Scripts > Shutdown.
  3. Then in the Properties window, click the Add option.
How to Automatically Clear Windows Cache when Shutdown 2
  1. Then select the Browser option, then find the script file that was created.
How to Automatically Clear Windows Cache when Shutdown 3
  1. Leave the column blank in the Script Parameters option. Click OK to save the settings.
How to Automatically Clear Windows Cache when Shutdown 4
  1. Click OK again to save the settings, as well as exit the Properties window.
  2. Done.

A little explanation about the contents of the script:

Related Articles
  • Del /S /F /Q %temp%: Deletes the temporary file from the User.
  • Del /S /F /Q %Windir%\Temp: Deletes temporary files in Windows.

After the process is complete, the system will clear the Windows cache automatically every time the computer is turned off.

Show More

Muhammad Azam

Don't think about what can happen in a month. Don't think what can happen on a year. Just focus on the 24 hours in front of you and do what you can to get closer to where you want to be.

Related Articles

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button

Adblock Detected!

If you enjoy our contents, please support our site by disabling your ad blocker or whitelisting us. We use ads to keep our content happy and free.