标题: [代码合集] 两个清除系统垃圾的批处理重复吗? [打印本页]
作者: mmkmm 时间: 2010-6-13 02:19 标题: 两个清除系统垃圾的批处理重复吗?
他们重复吗?
不重复的话有什么不同??
有什么专门的论坛吗???- @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%\*.log
- del /f /s /q %windir%\*.tmp
- del /f /s /q %windir%\*.bmp
- del /f /s /q %windir%\prefetch\*.*
- rd /s /q %windir%\temp & md %windir%\temp
- rd /s /q %temp% & md %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\Application
- del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
- del /f /s /q "%userprofile%\recent\*.*"
- del /f /s /q %windir%\inf\infcache.1
- del /f /s /q %windir%\drivers infcache.1
- del /f /s /q %windir%\drivers *.pnf
- del /f /s /q %windir%\inf\*.pnf
- Data\Iconcache.db"
- sfc /purgecache '清理系统盘无用文件
- defrag %systemdrive% -b '优化预读信息
- echo 清除系统LJ完成!
- echo. & pause
复制代码
- @echo off
- 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"
- del /a /f /s /q "%%a %%b\*.*"
- )
- ::跟上面几项未必是重复的(!),也是对当前用户目录
- echo 正在清理临时文件 (系统目录)……
- del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*.*"
- del /a /f /s /q "%userprofile%\Locals~1\Temp\*.*"
- del /a /f /s /q "%userprofile%\cookies\*.*"
- del /a /f /s /q "%userprofile%\recent\*.*"
- del /a /f /s /q "%Temp%\*.*"
- del /a /f /s /q "%Tmp%\*.*"
- del /a /f /s /q "%HomePath%\..\IconCache.db"
- echo 正在清理系统目录中的垃圾文件 (稍候,需要点时间)……
- del /a /f /s /q "%systemdrive%\*._mp"
- del /a /f /s /q "%systemdrive%\*.log"
- del /a /f /s /q "%systemdrive%\*.dmp"
- del /a /f /s /q "%systemdrive%\*.gid"
- del /a /f /s /q "%systemdrive%\*.old"
- del /a /f /s /q "%systemdrive%\*.tmp"
- del /a /f /s /q "%systemdrive%\recycled\*.*"
- del /a /f /s /q "%SystemRoot%\*.bak"
- del /a /f /s /q "%SystemRoot%\*.query"
- rd /s /q "%SystemRoot%\Downloaded Program Files"
- rd /s /q "%SystemRoot%\Offline Web Pages"
- rd /s /q "%systemroot%\Connection Wizard"
- rd /s /q "%SystemRoot%\SoftwareDistribution\Download"
- rd /s /q "%SystemRoot%\Assembly"
- rd /s /q "%SystemRoot%\Help"
- rd /s /q "%SystemRoot%\system32\ReinstallBackups"
- del /a /s /q "%SystemRoot%\inf\*.pnf"
- del /a /f /s /q "%SystemRoot%\inf\InfCache.1"
- dir %SystemRoot%\inf\*.* /ad/b >%SystemRoot%\vTmp.txt
- for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemRoot%\inf\%%a"
- del /a /f /s /q "%SystemRoot%\Driver Cache\*.pnf"
- del /a /f /s /q "%SystemRoot%\Driver Cache\InfCache.1"
- del /a /f /s /q "%SystemRoot%\system32\drivers\*.pnf"
- del /a /f /s /q "%SystemRoot%\system32\drivers\InfCache.1"
- rd /s /q "%SystemRoot%\temp" & md "%SystemRoot%\temp"
- del /a /f /s /q "%SystemRoot%\Prefetch\*.*"
- del /a /f /s /q "%SystemRoot%\minidump\*.*"
- echo 正在清除无用的磁盘检错文件 (系统分区)……
- del /a /f /q "%SystemDrive%\*.chk"
- dir %SystemDrive%\found.??? /ad/b >%SystemRoot%\vTmp.txt
- for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemDrive%\%%a"
- echo 正在清理系统升级补丁留下来的反安装目录 (已修正能正确清除)……
- dir %SystemRoot%\$*$ /ad/b >%SystemRoot%\vTmp.txt
- for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemRoot%\%%a"
- echo 正在清除常见的软件垃圾项目 (按默认目录)……
- rd /s /q "%ProgramFiles%\InstallShield Installation Information"
- Ren "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe" realsched.ex_
- Del "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe"
- Reg Delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v TkBellExe /f
- rd /s /q "%ProgramFiles%\Tencent\QQGame\Download"
- taskkill /f /im "TIMPlatform.exe" /t
- del /a /f /s /q "%ProgramFiles%\Kaspersky Lab\*.tmp"
- echo.
- echo 全部清理完毕,任意键退出 (注: 若提示文件没找到是正常的)……
- pause >nul
- del %SystemRoot%\vTmp.txt
复制代码
作者: sgaizxt001 时间: 2010-6-13 05:43
论坛有过讨论的帖子,我找不到了。第二个慎用。
第一个不清楚,不过看代码好像没有多大问题
作者: Batcher 时间: 2010-6-13 13:10
相关讨论:
网上流传的某些“删除系统垃圾的批处理”其实本身就是一个垃圾
http://bbs.bathome.net/viewthread.php?tid=684#pid7625
作者: michael8111 时间: 2010-6-14 08:07
这两个批处理有很多部分重复,只不过第一个用的是del /f /s /q,第二个用的是del /a /f /s /q而已,功能基本相同,第二个批处理增加了许多del,有很大危险性,这里建议最好不要用这类垃圾清除代码。
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |