
剛寫(xiě)的批處理清理系統(tǒng)垃圾文件幫我看看有什么要修改的
nclick="copycode($('code0'));">復(fù)制代碼
- @echo off
- ::清理系統(tǒng)垃圾文件(回收站/運(yùn)行/日志/網(wǎng)頁(yè)緩存/最近文檔等)
- ::常用類(lèi)型
- :: %userprofile%cookies------------------------------------ cookies記錄
- :: %userprofile%Local SettingsTemp------------------------ 用戶(hù)臨時(shí)文件夾
- :: %userprofile%LocalSettingsTemporaryInternet Files------ 網(wǎng)頁(yè)緩存目錄
- :: %userprofile%Local SettingsHistory--------------------- 網(wǎng)頁(yè)歷史記錄
- :: %userprofile%Recent------------------------------------- 最近的文檔
- :: %windir%prefetch---------------------------------------- 預(yù)讀取文件夾
- :: %windir%Temp-------------------------------------------- window臨時(shí)目錄
- :: %windir%SoftwareDistributiondownload------------------- window更新補(bǔ)丁目錄
- :: %systemdrive%*.tmp
- :: %systemdrive%*._mp
- :: %systemdrive%*.log
- :: %systemdrive%*.gid
- :: %systemdrive%*.chk
- :: %systemdrive%*.old
- :: %windir%*.bak
- ::日志類(lèi)型
- :: %windir%system32logfiles
- :: %windir%system32dtclog
- :: %windir%system32config*.evt----- 安全/系統(tǒng)/應(yīng)用程序日志(SecEvent.EVT/SysEvent.EVT/AppEvent.EVT)
- :: %windir%system32*.log
- :: %windir%system32*.txt
- :: %windir%*.txt
- :: %windir%*.log
- ::其他類(lèi)型
- :: hkcuSoftwareMicrosoftWindowsCurrentVersionExplorerRunMRU-----運(yùn)行記錄
- set allfile=%userprofile%cookies %userprofile%Local SettingsTemp %userprofile%LocalSettingsTemporaryInternet Files %userprofile%Local SettingsHistory %userprofile%Recent %windir%prefetch %windir%Temp %windir%SoftwareDistributiondownload %windir%system32logfiles %windir%system32dtclog
- set somefile=%systemdrive%*.tmp %systemdrive%*._mp %systemdrive%*.log %systemdrive%*.gid %systemdrive%*.chk %systemdrive%*.old %windir%*.bak %windir%system32config*.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 hkcuSoftwareMicrosoftWindowsCurrentVersionExplorerRunMRU /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

