回复 1# jyswjjgdwtdtj
发一个自用版本:- @echo off & color 0a & Title 系统垃圾文件清理器 & setlocal enabledelayedexpansion
- cd /d "%~dp0"
- %1 %2
- ver|find "5.">nul&&goto :Admin
- mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
- :Admin
-
- for /f "tokens=3 delims=, " %%a in ('echo ^|pnputil /enum-devices /disconnected ^|find "实例 ID:"') do echo 移除设备:%%a & pnputil /remove-device "%%a" >nul
- echo.
- echo,离线设备移除完毕
- echo.
- control RTSnMg64.cpl
- choice /t 2 /d y /n >nul
- tasklist|Find "RtkNGUI64.exe" >nul && (taskkill /f /t /IM RtkNGUI64.exe)
- tasklist|Find "RAVCpl64.exe" >nul && (taskkill /f /t /IM RAVCpl64.exe)
-
- del /f /s /q C:\Windows\Prefetch\*.*
-
- ::系统根目录清理
- if exist C:\360安全浏览器下载 (del /f /s /q C:\360安全浏览器下载\*.*)
- if exist C:\DVIDIA (del /f /s /q C:\DVIDIA\*.* & rd /s /q "C:\DVIDIA")
- if exist C:\AMD (del /f /s /q C:\AMD\*.* & rd /s /q "C:\AMD")
- if exist C:\DrvPath (del /f /s /q C:\DrvPath\*.* & rd /s /q "C:\DrvPath")
- if exist C:\Drivers (del /f /s /q C:\Drivers\*.* & rd /s /q "C:\Drivers")
- if exist "C:\ProgramData\Package Cache" (del /f /s /q "C:\ProgramData\Package Cache\*.*" & rd /s /q "C:\ProgramData\Package Cache")
-
- ::千牛缓存目录清理
- set dvs=c d e f
- for %%i in (!dvs!) do (
- if exist %%i:\AliWorkbenchData\ for %%j in (%%i) do (
- del /f /s /q %%j:\AliWorkbenchData\*.png
- del /f /s /q %%j:\AliWorkbenchData\*.jpg
- del /f /s /q %%j:\AliWorkbenchData\*.gif
- del /f /s /q %%j:\AliWorkbenchData\*.amr
- del /f /s /q %%j:\AliWorkbenchData\*.dat
- del /f /s /q %%j:\AliWorkbenchData\*.jfif
- del /f /s /q %%j:\AliWorkbenchData\*.json
- del /f /s /q %%j:\AliWorkbenchData\*.tmp
- del /f /s /q %%j:\AliWorkbenchData\*.tmp
- del /f /s /q %%j:\AliWorkbenchData\IMServiceDir\portrait_image\*.*
- for /f "delims=" %%a in ('dir /ad/b/s %%j:\AliWorkbenchData\ ^|sort /r') do rd "%%a" 2>nul
- )
- )
- del "%USERPROFILE%\AppData\Roaming\AliWorkbench\Update" /f /s /q
- del "%USERPROFILE%\AppData\Roaming\AliWorkbench\ReplaceImage" /f /s /q
- for /f "delims=" %%a in ('dir /ad/b/s %USERPROFILE%\AppData\Roaming\AliWorkbench\ ^|sort /r') do rd "%%a" 2>nul
-
- ::酷我音乐缓存清理
- del "C:\Users\All Users\kuwodata\kwmusic2013\Res\cache" /f /s /q
- rd "C:\Users\All Users\kuwodata\kwmusic2013\Res\cache" /s /q
- ::Adobe媒体缓存清理
- del "%USERPROFILE%\AppData\Roaming\Adobe\Common\Media Cache Files" /f /s /q
- rd "%USERPROFILE%\AppData\Roaming\Adobe\Common\Media Cache Files" /s /q
-
- ::腾讯QQ记录清理
- del "%USERPROFILE%\Documents\Tencent Files" /f /s /q
- rd "%USERPROFILE%\Documents\Tencent Files" /s /q
- del "%USERPROFILE%\AppData\Roaming\Tencent\Logs" /f /s /q
- rd "%USERPROFILE%\AppData\Roaming\Tencent\Logs" /s /q
- ::微信清理
- del "%USERPROFILE%\Documents\WeChat Files" /f /s /q
- rd "%USERPROFILE%\Documents\WeChat Files" /s /q
- ::钉钉清理
- del "%USERPROFILE%\AppData\Roaming\DingTalk" /f /s /q
- rd "%USERPROFILE%\AppData\Roaming\DingTalk" /s /q
-
- ::清除系统缓存目录
- del "%USERPROFILE%\AppData\Local\Temp" /f /s /q
- rd "%USERPROFILE%\AppData\Local\Temp" /s /q
- if not exist "%USERPROFILE%\AppData\Local\Temp" (md "%USERPROFILE%\AppData\Local\Temp")
- del %systemdrive%\Windows\temp /f /s /q
- rd %systemdrive%\Windows\temp /s /q
- if not exist "%systemdrive%\Windows\temp" (md "%systemdrive%\Windows\temp")
-
- ::删除windows update更新日志及相关补丁下载文件
- del "C:\Windows\SoftwareDistribution\Download" /f /s /q
- rd "C:\Windows\SoftwareDistribution\Download" /s /q
-
- echo 删除回收站的无用文件
- for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if exist %%a:\$recycle.bin (
- pushd %%a:\$recycle.bin
- for /f %%b in ('dir /b /a') do (rd /s /q %%b)
- )
- )
-
- echo 删除打开文件记录快捷方式
- if exist "%userprofile%\recent\" (del /f /s /q "%userprofile%\recent\*.*")
- if exist "%userprofile%\AppData\Roaming\Microsoft\Windows\Recent\" (del /f /s /q "%userprofile%\AppData\Roaming\Microsoft\Windows\Recent\*.*")
-
- mshta vbscript:msgbox("系统垃圾清理完成!")(window.close)
-
- exit
复制代码
|