- @echo off
-
- ::清理系统垃圾文件(回收站/运行/日志/网页缓存/最近文档等)
- ::常用类型
- :: "%userprofile%\Cookies\" ------------------------------------ Cookies记录
- :: "%userprofile%\Local Settings\Temp\" ------------------------ 用户临时文件夹
- :: "%userprofile%\LocalSettings\TemporaryInternet Files\" ------ 网页缓存目录
- :: "%userprofile%\Local Settings\History\" --------------------- 网页历史记录
- :: "%userprofile%\Recent\" ------------------------------------- 最近的文档
- :: "%windir%\prefetch\" ---------------------------------------- 预读取文件夹
- :: "%windir%\Temp\" -------------------------------------------- window临时目录
- :: "%windir%\SoftwareDistribution\download\" ------------------- window更新补丁目录
- :: "%systemdrive%\*.tmp"
- :: "%systemdrive%\*._mp"
- :: "%systemdrive%\*.log"
- :: "%systemdrive%\*.gid"
- :: "%systemdrive%\*.chk"
- :: "%systemdrive%\*.old"
- :: "%windir%\*.bak"
-
- ::日志类型
- :: "%windir%\system32\logfiles\"
- :: "%windir%\system32\dtclog\"
- :: "%windir%\system32\config\*.evt" ----- 安全/系统/应用程序日志(SecEvent.EVT/SysEvent.EVT/AppEvent.EVT)
- :: "%windir%\system32\*.log"
- :: "%windir%\system32\*.txt"
- :: "%windir%\*.txt"
- :: "%windir%\*.log"
-
- ::其他类型
- :: "hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" -----运行记录
-
- set allfile="%userprofile%\Cookies\" "%userprofile%\Local Settings\Temp\" "%userprofile%\LocalSettings\TemporaryInternet Files\" "%userprofile%\Local Settings\History\" "%userprofile%\Recent\" "%windir%\prefetch\" "%windir%\Temp\" "%windir%\SoftwareDistribution\download\" "%windir%\system32\logfiles\" "%windir%\system32\dtclog\"
- set somefile="%systemdrive%\*.tmp" "%systemdrive%\*._mp" "%systemdrive%\*.log" "%systemdrive%\*.gid" "%systemdrive%\*.chk" "%systemdrive%\*.old" "%windir%\*.bak" "%windir%\system32\config\*.evt" "%windir%\system32\*.log" "%windir%\*.txt" "%windir%\*.log"
- for %%a in (%allfile%) do del /s /f /q /a %%a >nul 2>nul
- for %%b in (%somefile%) do del /f /q /a %%b >nul 2>nul
-
- reg delete "hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /f >nul 2>nul
-
- ::删除回收站文件
- for %%c 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 %%c: (
- for %%d in (Recycler Recycled) do (
- if exist %%c:\%%d (
- rd /s /q "%%c:\%%d\" >nul 2>nul
- )
- )
- )
- )
- taskkill /f /im explorer.exe >nul 2>nul
- start explorer.exe
复制代码
|