A powerful Windows batch script designed to clean up temporary files, cache, and optimize system performance by removing unnecessary files that accumulate over time.
- Windows Temp Folder Cleanup: Removes all temporary files from
C:\Windows\Temp - Prefetch Cleanup: Clears Windows prefetch files to free up space
- User Temp Cleanup: Removes temporary files from the current user's temp folder
- DNS Cache Flush: Flushes the DNS resolver cache for improved network performance
- Windows Update Cache Cleanup: Cleans up Windows Update download cache
- Recycle Bin Cleanup: Empties the Recycle Bin completely
- Automatic Administrator Privileges: Automatically requests admin rights when needed
- Operating System: Windows 7, 8, 10, 11, or Windows Server
- Privileges: Script requires Administrator privileges (automatically requested)
- Batch File Support: Windows Command Prompt or PowerShell
- Download or clone the repository
- Locate the
clear_cache.batfile - Double-click the file to run
- If prompted by UAC (User Account Control), click "Yes" to grant administrator privileges
- Wait for the cleanup process to complete
- Press any key to close the window when finished
- Open Command Prompt
- Navigate to the directory containing
clear_cache.bat:cd path\to\WinClean - Run the script:
clear_cache.bat
- Grant administrator privileges when prompted
- Right-click on
clear_cache.bat - Select "Run as administrator"
- Wait for the cleanup process to complete
- Administrator Rights Required: This script requires administrator privileges to access system folders
- File Deletion: This script permanently deletes temporary files. Make sure you don't have important data in temp folders
- Active Applications: Close any important applications before running to avoid potential data loss
- System Stability: While safe for most systems, always ensure you have important files backed up
- Windows Update: The script temporarily stops Windows Update service during cleanup
| Location | Description |
|---|---|
C:\Windows\Temp |
System-wide temporary files |
C:\Windows\Prefetch |
Application prefetch data |
%TEMP% |
Current user's temporary files |
| DNS Cache | Network DNS resolver cache |
C:\Windows\SoftwareDistribution\Download |
Windows Update cache |
C:\$Recycle.bin |
Recycle Bin contents |
- Ensure you have administrator privileges
- Check if your antivirus is blocking the script
- Verify that batch file execution is not disabled by group policy
- Make sure you granted administrator privileges when prompted
- Some files may be in use by running applications - close them and try again
- Check if the locations being cleaned actually contain files
- Verify that Windows Defender or antivirus isn't preventing file deletion
Contributions are welcome! If you have suggestions for improvements or additional cleanup features, please feel free to:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Owner: Thamindu-Dev
- GitHub: @Thamindu-Dev
- Repository: WinClean
- Thanks to all contributors who help improve this tool
- Inspired by the need for a simple, effective Windows cleanup solution
If you encounter any issues or have questions:
- Open an issue on the GitHub repository
- Check the troubleshooting section above
- Review existing issues for similar problems
Note: This script is provided as-is. Always review scripts before running them with administrator privileges. Regular use can help maintain system performance, but always ensure you have backups of important data.