一键清理垃圾的txt代码是多少啊?

一键清理垃圾的txt代码是多少啊?,第1张

@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 清除系统LJ完成!

echo. &pause

把后缀名 .txt改为.bat 然后点击保存

@echo off

::ZghSgi, 修正于2007-03-06

color 2f

Title 系统垃圾文件清理器 By Phexon And ZghSgi 2007

echo.

echo ***** 系统垃圾文件清理器 *****

echo 制作:Phexon 2006

 搭巧 echo Fix:ZghSgi 2007

echo.

echo 本程序特点:

echo 鉴于很多人把IE缓存等文件夹转移到非系统盘,

echo 所以,本程序清理垃圾文件时,首先进行判断系统

echo 的设置。

echo.

echo 优点:清理位置更加准确,策略更加科学。

echo.

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">Nul 2>Nul

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

)

::跟上面几项未必是重复的(!),也是对当前用户目录

echo 正在清理临枝洞时文件 (系统目录)……

del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*.*" >Nul 2>Nul

del /a /f /s /q "%userprofile%\Locals~1\Temp\*.*" >Nul 2>Nul

del /a /f /s /q "%userprofile%\cookies\*.*" >Nul 2>Nul

del /知搭键a /f /s /q "%userprofile%\recent\*.*" >Nul 2>Nul

del /a /f /s /q "%Temp%\*.*" >Nul 2>Nul

del /a /f /s /q "%Tmp%\*.*" >Nul 2>Nul

del /a /f /s /q "%HomePath%\..\IconCache.db" >Nul 2>Nul

echo 正在清理系统目录中的垃圾文件 (稍候,需要点时间)……

del /a /f /s /q "%SystemRoot%\*._mp">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.bak">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.log">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.dmp">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.gid">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.old">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\*.query">Nul 2>Nul

del /a /f /q "%SystemRoot%\*.tmp">Nul 2>Nul

rd /s /q "%SystemRoot%\Downloaded Program Files" >Nul 2>Nul

rd /s /q "%SystemRoot%\Offline Web Pages" >Nul 2>Nul

rd /s /q "%systemroot%\Connection Wizard" >Nul 2>Nul

rd /s /q "%SystemRoot%\SoftwareDistribution\Download" >Nul 2>Nul

rd /s /q "%SystemRoot%\Assembly" >Nul 2>Nul

rd /s /q "%SystemRoot%\Help" >Nul 2>Nul

rd /s /q "%SystemRoot%\ReinstallBackups" >Nul 2>Nul

del /a /s /q "%SystemRoot%\inf\*.pnf" >Nul 2>Nul

del /a /f /s /q "%SystemRoot%\inf\InfCache.1" >Nul 2>Nul

dir %SystemRoot%\inf\*.* /ad/b >%SystemRoot%\vTmp.txt

for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemRoot%\inf\%%a" >Nul 2>Nul

del /a /f /s /q "%SystemRoot%\driver?\*.pnf" >Nul 2>Nul

del /a /f /s /q "%SystemRoot%\driver?\InfCache.1" >Nul 2>Nul

del /a /f /s /q "%SystemDrive%\driver?\*.pnf" >Nul 2>Nul

del /a /f /s /q "%SystemDrive%\driver?\InfCache.1" >Nul 2>Nul

rd /s /q "%SystemRoot%\temp" &md "%SystemRoot%\temp" >Nul 2>Nul

del /a /f /s /q "%SystemRoot%\Prefetch\*.*">Nul 2>Nul

del /a /f /s /q "%SystemRoot%\minidump\*.*">Nul 2>Nul

echo 正在清除无用的磁盘检错文件 (系统分区)……

del /a /f /q "%SystemDrive%\*.chk" >Nul 2>Nul

dir %SystemDrive%\found.??? /ad/b >%SystemRoot%\vTmp.txt

for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemDrive%\%%a" >Nul 2>Nul

echo 正在清理系统升级补丁留下来的反安装目录 (已修正能正确清除)……

dir %SystemRoot%\$*$ /ad/b >%SystemRoot%\vTmp.txt

for /f %%a in (%SystemRoot%\vTmp.txt) do rd /s /q "%SystemRoot%\%%a" >Nul 2>Nul

echo 正在清除常见的软件垃圾项目 (按默认目录)……

rd /s /q "%ProgramFiles%\InstallShield Installation Information" >Nul 2>Nul

Ren "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe" realsched.ex_ >Nul 2>Nul

Del "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe" >Nul 2>Nul

Reg Delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v TkBellExe /f >Nul 2>Nul

rd /s /q "%ProgramFiles%\Tencent\QQGame\Download" >Nul 2>Nul

taskkill /f /im "TIMPlatform.exe" /t >Nul 2>Nul

del /a /f /s /q "%ProgramFiles%\Tencent\QQ\TIMPlatform.exe" >Nul 2>Nul

del /a /f /s /q "%ProgramFiles%\PKaspersky Lab\*.tmp" >Nul 2>Nul

echo.

echo 全部清理完毕,任意键退出 (注: 若提示文件没找到是正常的)……

pause>nul

del %SystemRoot%\vTmp.txt

把这些内容拷贝到记事本中,另存为选“所有文件”,文件名输入为:清理垃圾.bat


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12230516.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-22
下一篇 2023-05-22

发表评论

登录后才能评论

评论列表(0条)

保存