缓存清理

By 甘小蔗    2018/02/23

缓存清理v1.1.bat:

@echo off set ver=1.1 title 缓存清理 By MCSugar_cane v%ver% - %date% %time:~0,-6% echo 请勿把此批处理放入以下文件夹内执行: echo %temp% echo %windir%\temp echo %userprofile%\cookies setlocal enabledelayedexpansion set t= for /l %%a in (1 1 80) do ( set "t=>!t!" set /p=!t!nul ) endlocal cls echo. echo 正在加载今日(%date:~0,-4%)缓存... echo. echo 正在加载 %temp% 处缓存: [%time%] mshta "javascript:document.write();setTimeout('close()',300);" for /r %temp% %%i in (*.*) do echo %%i echo. echo 正在加载 %windir%\temp 处缓存: [%time%] mshta "javascript:document.write();setTimeout('close()',300);" for /r %windir%\temp %%i in (*.*) do echo %%i echo. echo 正在加载 %userprofile%\cookies 处缓存: [%time%] mshta "javascript:document.write();setTimeout('close()',300);" for /r "%userprofile%\cookies" %%i in (*.*) do echo %%i echo. echo 正在加载 %systemdrive% 处缓存: [%time%] mshta "javascript:document.write();setTimeout('close()',500);" for /r %systemdrive% %%i in (*.tmp) do echo %%i for /r %systemdrive% %%i in (*._mp) do echo %%i for /r %systemdrive% %%i in (*.log) do echo %%i for /r %systemdrive% %%i in (*.gid) do echo %%i for /r %systemdrive% %%i in (*.chk) do echo %%i for /r %systemdrive% %%i in (*.old) do echo %%i for /r "%systemdrive%\recycled" %%i in (*.*) do echo %%i echo 加载完成,是否清除?(Y/N) Enter确认 set /p choose= if /i "%choose%"=="Y" call :CleanTemp pause>nul&exit :CleanTemp echo. echo 正在执行 清除缓存 ... echo. echo. 即将清理 "%temp%" 缓存 mshta "javascript:document.write();setTimeout('close()',300);" for /r %temp% %%i in (*.*) do ( echo 已清除 %%i ... del /q %%i ) echo. echo. 即将清理 "%windir%\temp" 缓存 mshta "javascript:document.write();setTimeout('close()',300);" rd /s /q %windir%\temp & md %windir%\temp echo. echo. 即将清理 "%userprofile%\cookies" 缓存 mshta "javascript:document.write();setTimeout('close()',300);" for /r "%userprofile%\cookies" %%i in (*.*) do ( echo 已清除 %%i ... del /f /q %%i ) echo. echo. 即将清理 %systemdrive% 缓存 mshta "javascript:document.write();setTimeout('close()',300);" echo 正在清理 %systemdrive% 缓存...... 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\*.* mshta "javascript:document.write();setTimeout('close()',300);" echo 清理系统垃圾完成! rem By 甘小蔗

使用方法:

将上诉代码全部复制后粘贴在记事本(.txt)中后保存,再将该记事本后缀改为.bat后双击即可运行。