Manually clean up cache files on Windows 10 through BAT scripts

Author: fan    Posted: 24 July 2020   Viewed: 2657 times   Tag: #Windows 10 

As we know, Windows system will generate junk cache files. The steps here will teach user on how to delete Unnecessary files Cache on your System.


One-click bat code for cleaning system cache files:


1. Create a new text document in a blank space on the computer desktop


2. After the creation is complete, copy and paste the following text into the text document. As shown below:


@echo off

echo is clearing system junk files, please wait...

del /f /s /q %systemdrive%*.tmp

del /f /s /q %systemdrive%*._mp

del /f /s /q %systemdrive%*.log

del /f /s /q %systemdrive%*.gid

del /f /s /q %systemdrive%*.chk del /f /s /q %systemdrive%*.old

del /f /s /q %systemdrive% ecycled*.*

del /f /s /q %windir%*.bak

del /f /s /q %windir%prefetch*.* rd /s /q %windir% emp & md %windir% emp

del /f /q %userprofile%cookies*.*

del /f /q %userprofile% ecent*.*

del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"

del /f /s /q "%userprofile%Local SettingsTemp*.*"

del /f /s /q "%userprofile% ecent*.*" Echo clear system garbage is complete!

echo. & pause





3. After copying is complete, click File and Save As. After the Save As window pops up, the save type is changed to all files, the save path is customized, and the file name is customized (Note: the file name suffix needs to be added with ".bat")





4. Finally, a bat batch file is generated, we right click on it and choose to run as administrator, and the system will automatically clean up junk files.




Your Kind Action