批處理清理系統垃圾_xp

批處理文件如下:

@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 清除System junk完成!
echo. & pause

======
@echo off
color 1B
title 清理系統垃圾工具
echo 正在清理系統垃圾及安裝殘留文件,請稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.ms
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\*.ftg
del /f /s /q %systemdrive%\*.fts
del /f /s /q %systemdrive%\*.syd
del /f /s /q %systemdrive%\*.diz
del /f /s /q %systemdrive%\*.??$
del /f /s /q %systemdrive%\*.??~
del /f /s /q "%systemdrive%\*.$$$
del /f /s /q "%systemdrive%\*.~*
del /f /s /q "%systemdrive%\*.@@@
del /f /s /q %systemdrive%\recycled\*.*
del /a /f /s /q %systemroot%\*.query
del /f /s /q %systemRoot%\Downloaded Program Files\*.*
del /f /s /q %systemRoot%\Offline Web Pages\*.*
del /f /s /q %systemRoot%\*.bak
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\*.log
del /f /s /q %windir%\*.tmp
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
rd/s/q %windir%\temp & md %windir%\tempemp% &md %temp%
del /f /s /q "%appdata%\Microsoft\Windows\cookies\*.*
rd /S /q %systemRoot%\temp" & md "%systemRoot%\temp
del /f /q %userprofile%\s\*.*
del /f /q %userprofile%\S s\*.*
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%\AppData\Roaming\Microsoft\Windows\Cookies\*.txt"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
del /f /s /q %windir%\SoftwareDistribution\Download\*.*
rd /s /q "%userprofile%\Local Settings\Temp\" & md "%userprofile%\Local Settings\Temp\"
del /f /s /q "%appdata%\Microsoft\Windows\Recent\*.*"
for /d %%a in ("%temp%\*.*") do rd /s /q "%%a"
del /a /f /s /q "%temp%\*.*" 2>nul
for /d %%a in ("%tmp%\*.*") do rd /s /q "%%a"
del /a /f /s /q "%tmp%\*.*" 2>nul
for /f "tokens=1" %%i in ('dir %SystemRoot%\$*$ /s /b /ad') do rd /s /q %%i

echo 正在正在清理IE緩存、cookies、歷史紀錄等(當前用戶)...

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>vtemp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>vtemp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>vtemp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v NetHood>>vtemp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Recent>>vtemp.txt

for /f "tokens=3*" %%a in (vtemp.txt) do (

for /d %%i in ("%%a %%b\*.*") do rd /s /q "%%i" 2>Nul

del /a /f /s /q "%%a %%b\*.*" del /q vtemp.txt 2>Nul

)

echo 清除瀏覽器地址記錄...

reg delete "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedUrls" /f 2>nul

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedUrls"

echo 清除運行記錄...

reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /f 2>nul

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "MRUList" /t reg_sz /d "a" /f         

sfc /purgecache '清理系統盤無用文件    
defrag %systemdrive% -b '優化預讀信息    
cls
echo 系統垃圾清理完成!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章