Category filter

Script to Clear Cache and Temporary Files on Windows devices

Clearing all caches in Windows usually helps a lot if your device is slowing down or exhibiting suboptimal performance. This usually happens when you’ve been on the internet for a while, installed Windows updates, or haven’t reset your computer in a long time.

For a variety of reasons, clearing your cache on a regular basis enhances the efficiency of your system. Depending on your settings, a cache can get rather large and take up a lot of disc space on your computer. The more data saved in the cache, the slower your computer will browse the web or do routine tasks. Delete the cache data to aid debugging, improve web page loading times, and boost your computer’s performance.

Using Hexnode, you can deploy scripts to effortlessly delete all temporary files and directories as well as empty the recycle bin.

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

Powershell Script

Batch Script

Notes:

  • Once the script is run successfully, restart your device for the changes to take effect.
  • Windows do not allow any files or folders that are still in use to be deleted.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository