您的位置:首页 > 其它

51CTO技术圈:系统垃圾文件快速清理增强版.bat

2010-08-05 16:16 936 查看
将以下内容复制,粘贴到记事本里面,然后另存为“51CTO技术圈:系统垃圾文件快速清理增强版.bat”文件(文件名不含引号),接着双击运行,就可以清除这些文件夹了。以后每隔几天就双击运行一下这个批处理文件,就可以清除掉很多垃圾文件。

@echo off
color 5e
Title ◆51CTO技术圈:系统垃圾文件快速清理增强版◆
echo.
ECHO 正在检查cookies、历史纪录等目录位置(当前用户)......
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v NetHood>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Recent>>%temp%\cleantmp.txt
ECHO 正在清理Cookies、IE缓存、历史纪录等(当前用户)......
for /f "tokens=3*" %%a in (%temp%\cleantmp.txt) do (
for /d %%i in ("%%a %%b\*.*") do rd /s /q "%%i" >nul 2>nul
del /a /f /s /q "%%a %%b\*.*" >nul 2>nul
)
:: 清理运行栏中的历史纪录,在注销或者重启后将生效......
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f
ECHO 正在清理系统升级补丁留下来的反安装目录和备份文件......
rd /s /q "%windir%\$hf_mig$\" >nul 2>nul
dir "%SystemRoot%\$*$" /ad/b >%SystemRoot%\temp\updatetmp.txt
for /f %%a in (%SystemRoot%\temp\updatetmp.txt) do rd /s /q "%SystemRoot%\%%a" >nul 2>nul
dir "%SystemRoot%\SoftwareDistribution\Download\*" /ad/b >%SystemRoot%\temp\updatetmp1.txt
for /f %%a in (%SystemRoot%\temp\updatetmp1.txt) do (
rd /s /q "%SystemRoot%\SoftwareDistribution\Download\%%a" >nul 2>nul
del /a /f /s /q "%SystemRoot%\SoftwareDistribution\Download\*" >nul 2>nul
)
taskkill /f /im "wuauclt.exe" /t
del /a /f /s /q "%SystemRoot%\SoftwareDistribution\DataStore\DataStore.edb" >nul 2>nul
ECHO 正在清理系统临时文件和系统目录中的垃圾文件......
del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*" >nul 2>nul
dir "%userprofile%\Locals~1\Temp\*" /ad/b >%SystemRoot%\temp\usertmp.txt
for /f %%a in (%SystemRoot%\temp\usertmp.txt) do rd /s /q "%userprofile%\Locals~1\Temp\%%a" >nul 2>nul
del /a /f /s /q "%userprofile%\Locals~1\Temp\*" >nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /a /f /s /q "%userprofile%\recent\*" >nul 2>nul
del /a /f /s /q "%userprofile%\cookies\*" >nul 2>nul
del /a /f /s /q "%HomePath%\..\IconCache.db" >nul 2>nul
del /a /f /s /q "%windir%\temp\*" >nul 2>nul
del /a /f /s /q "%windir%\prefetch\*" >nul 2>nul
del /a /f /s /q "%SystemRoot%\*.log" >nul 2>nul
del /a /f /q "%SystemRoot%\*.tmp" >nul 2>nul
ECHO 正在清理Realplayer垃圾项目......
del /a /f /s /q "%appdata%\Real\RealPlayer\History\*" >nul 2>nul
if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.*>nul 2>nul
del /f /s /q %systemdrive%\*._mp
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\*.*
del /f /s /q %windir%\Magicset\*.reg
del /f /s /q %windir%\KB*.log
rd /s /q %windir%\drivers
rd /s /q "%temp%\"
rd /s /q %windir%\$hf_mig$
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
attrib -s -h -r "C:\Program Files\Common Files\System\9DOA0215.DLL"
del /f /q "C:\Program Files\Common Files\System\9DOA0215.DLL"
attrib -s -h -r "C:\Program Files\Common Files\Microsoft Shared\MSInfo\2A1D0905.dll"
del /f /q "C:\Program Files\Common Files\Microsoft Shared\MSInfo\2A1D0905.dll"
attrib -s -h -r %windir%\system32\drivers\abhcop.sys
del /f /q %windir%\system32\drivers\abhcop.sys
attrib -s -h -r %windir%\system32\drivers\hcalway.sys
del /f /q %windir%\system32\drivers\hcalway.sys
attrib -s -h -r %windir%\system32\drivers\sptd.sys
del /f /q %windir%\system32\drivers\sptd.sys
del /f /s /q "%windir%\system32\THIRDA\*.*"
rd /s /q %windir%\system32\THIRDA
rd /s /q C:\found.000
rd /s /q C:\found.001
rd /s /q C:\found.002
rd /s /q C:\found.003
rd /s /q C:\found.004
rd /s /q C:\found.005
rd /s /q C:\found.006
rd /s /q C:\found.007
rd /s /q C:\found.008
rd /s /q C:\vod_cache_data\
rd /s /q D:\found.000
rd /s /q D:\found.001
rd /s /q D:\found.002
rd /s /q D:\found.003
rd /s /q D:\found.004
rd /s /q D:\found.005
rd /s /q D:\found.006
rd /s /q D:\found.007
rd /s /q D:\vod_cache_data\
rd /s /q E:\found.000
rd /s /q E:\found.001
rd /s /q E:\found.002
rd /s /q E:\found.003
rd /s /q E:\found.004
rd /s /q E:\found.005
rd /s /q E:\vod_cache_data\
rd /s /q F:\found.000
rd /s /q F:\found.001
rd /s /q F:\found.002
rd /s /q F:\found.003
rd /s /q F:\found.004
rd /s /q F:\found.005
rd /s /q F:\vod_cache_data\
attrib -a -h -s -r C:\autorun.exe
attrib -a -h -s -r C:\autorun.cmd
attrib -a -h -s -r C:\autorun.inf
attrib -a -h -s -r C:\auto.exe
attrib -a -h -s -r C:\pagefile.lnk
del /f /q C:\autorun.exe
del /f /q C:\autorun.cmd
del /f /q C:\autorun.inf
del /f /q C:\auto.exe
del /f /q C:\pagefile.lnk
attrib -a -h -s -r D:\autorun.exe
attrib -a -h -s -r D:\autorun.cmd
attrib -a -h -s -r D:\autorun.inf
attrib -a -h -s -r D:\auto.exe
attrib -a -h -s -r D:\pagefile.lnk
del /f /q D:\autorun.exe
del /f /q D:\autorun.cmd
del /f /q D:\autorun.inf
del /f /q D:\auto.exe
del /f /q D:\pagefile.lnk
attrib -a -h -s -r E:\autorun.exe
attrib -a -h -s -r E:\autorun.cmd
attrib -a -h -s -r E:\autorun.inf
attrib -a -h -s -r E:\auto.exe
attrib -a -h -s -r E:\pagefile.lnk
del /f /q E:\autorun.exe
del /f /q E:\autorun.cmd
del /f /q E:\autorun.inf
del /f /q E:\auto.exe
del /f /q E:\pagefile.lnk
attrib -a -h -s -r F:\autorun.exe
attrib -a -h -s -r F:\autorun.cmd
attrib -a -h -s -r F:\autorun.inf
attrib -a -h -s -r F:\auto.exe
attrib -a -h -s -r F:\pagefile.lnk
del /f /q F:\autorun.exe
del /f /q F:\autorun.cmd
del /f /q F:\autorun.inf
del /f /q F:\auto.exe
del /f /q F:\pagefile.lnk
attrib -a -h -s -r C:\progra~1\*.exe
del /f /q C:\progra~1\*.exe
attrib -a -h -s -r C:\progra~1\*.inf
del /f /q C:\progra~1\*.inf
attrib -a -h -s -r C:\progra~1\Common~1\*.exe
del /f /q C:\progra~1\Common~1\*.exe
attrib -a -h -s -r C:\progra~1\Common~1\system\*.exe
del /f /q C:\progra~1\Common~1\system\*.exe
attrib -a -h -s -r "C:\System Volume Information\*.*"
attrib -a -h -s -r "D:\System Volume Information\*.*"
attrib -a -h -s -r "E:\System Volume Information\*.*"
attrib -a -h -s -r "F:\System Volume Information\*.*"
del /f /s /q "C:\System Volume Information\*.*"
del /f /s /q "D:\System Volume Information\*.*"
del /f /s /q "E:\System Volume Information\*.*"
del /f /s /q "F:\System Volume Information\*.*"
cls
@echo .
@echo ……恭喜!您的电脑垃圾文件清理任务 已经完成!
@echo . ……感谢您访问51CTO技术圈,请任意键退出!
@pause
@exit
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: