Welcome Buddy!

Get Started
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.
cnwintech how to automatically clear windows cache when shutdown 3
  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.
cnwintech how to automatically clear windows cache when shutdown 4
  1. Then select the Browser option, then find the script file that was created.
cnwintech how to automatically clear windows cache when shutdown 5
  1. Leave the column blank in the Script Parameters option. Click OK to save the settings.
cnwintech how to automatically clear windows cache when shutdown 6
  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:

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

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

Leave a Reply

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

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

Check Also
Close
Subscribe Now
Advertisement
Back to top button
Close

Adblock Detected!

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