在记事本中复制如下内容,然后将文件后缀txt替换为bat,然后鼠标右键用管理员身份运行即可,若直接双击,部分文件夹因没有权限而放弃清除。
原理是清除相应文件夹中的结尾为 tmp,mp,log,gid,chk,old,bak的文件,和垃圾箱,或其他缓存位置的所有文件。
@echo off
echo 开始清除系统垃圾文件,请等候
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%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统垃圾文件完成!
echo. & pause