sb051 发表于 2011-12-1 22:57 只看TA 1楼 |
---|
|
[交流] 清理垃圾文件的批处理文件 刚刚看了heetion 今天发的帖子 我只想在补充点。自己收集整理的。把下面的内容复制完整复制: @echo off color 2b Title 系统垃圾文件清理程序 echo 开始执行清理…… 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" 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 "%SystemRoot%\*._mp" del /a /f /s /q "%SystemRoot%\*.bak" del /a /f /s /q "%SystemRoot%\*.log" del /a /f /s /q "%SystemRoot%\*.dmp" del /a /f /s /q "%SystemRoot%\*.gid" del /a /f /s /q "%SystemRoot%\*.old" del /a /f /s /q "%SystemRoot%\*.query" del /a /f /q "%SystemRoot%\*.tmp" 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%\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?\*.pnf" del /a /f /s /q "%SystemRoot%\driver?\InfCache.1" del /a /f /s /q "%SystemDrive%\driver?\*.pnf" del /a /f /s /q "%SystemDrive%\driver?\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%\Tencent\QQ\TIMPlatform.exe" del /a /f /s /q "%ProgramFiles%\Kaspersky Lab\*.tmp" del %SystemRoot%\vTmp.txt echo 清理完毕,任意键退出 复制完毕后,在电脑桌面新建一个记事本,把复制的内容粘贴到记事本里面,保存退出。文件名 改垃圾清理 然后把此文档的扩展名.txt 改成.bat 怎么改 我接着发个简单修改方法。 |
0 |
heetion 发表于 2011-12-3 16:28 只看TA 6楼 |
---|
回复 4楼 的帖子 no no no,不是这样的,我觉得这个倒是更适合菜鸟用,批处理本身体积就很小,放桌面上一点就完事~另外,用360清理的速度确实比批处理的慢很多,因为之前还要扫描,而且最后还清理不干净, 这是很早以前用批处理的理由,到现在依然是这个问题,你可以自己测试下就知道了~ |
0 |
boning1001 发表于 2011-12-3 19:58 只看TA 7楼 |
---|
这里面到低写了什么代码我们菜鸟啥也看不明白,还是用大牌的清理工具安全![]() |
0 |
|
---|