This is a simple but powerful batch script that clears various types of cache and temporary files in Windows, resets DNS, and performs a deep clean to free up disk space and improve system performance.
β οΈ Warning: This script deletes system cache and temporary files. Use it with administrator privileges and at your own risk.
This script performs the following tasks:
- π« Clears user and system temporary files
- π Deletes contents of:
%TEMP%C:\Windows\TempC:\Windows\Prefetch%APPDATA%\Microsoft\Windows\Recent
- π Flushes DNS cache:
ipconfig /flushdns - π§ Resets Windows Update cache:
- Stops
wuauservandbits - Deletes
C:\Windows\SoftwareDistribution - Restarts services
- Stops
- πͺ Kills and restarts
explorer.exe - π§½ Runs Disk Cleanup silently with pre-configured settings (
cleanmgr /sagerun:1) - π Clears Microsoft Store cache:
wsreset - π§ Clears clipboard contents
- π§ Clears ARP cache:
arp -d *
- Download or copy the contents of
cleanup.bat. - Save it to your Desktop or another easy-to-access location.
- Right-click the file and select Run as Administrator.
- Follow the prompts in the command window.
- Windows 10, 11, or Server (Admin rights required)
- Cleanmgr must be pre-configured if using
/sagerun:1
To configure cleanmgr:
cleanmgr /sageset:1