本帖最后由 cjiabing 于 2014-4-21 11:50 编辑
名称:一键清理三剑客V1.2.bat
语言:批处理
功能:包含一键清理非系统进程,一键清理临时文件,一键清理自启动项,一键清理计划任务。系统开机慢、运行慢、上网慢,推荐使用一键清理三剑客。三剑客专治三慢病!~
环境:cmd@xp/7
更新日期:20140421(修改了清理自启动项的代码,如果不能全部删除自启动项则逐条尝试删除)
下载:
外链:http://dl.vmall.com/c09nwu0g3b (压缩包更新不及时,请参照论坛代码)
- @echo off&cls&title 一键清理三剑客 V1.2.4 cmd@winXP/7 by cjiabing from http://www.bathome.net
- echo 开机慢、运行慢、上网慢,推荐使用一键清理三剑客,三剑客专治三慢病!
- echo.&echo.&echo.&echo.
- echo 一键清理非系统进程 cmd@winXP/7
- echo.&echo.
- echo ◇ 执行过程中请勿关闭本程序!如被防火墙拦截请允许运行!
- echo ◇ 假如无法自动恢复桌面,请重新执行一次。或:
- echo 1、用组合键【Ctrl+Alt+Del】打开【任务管理器】;
- echo 2、在【新建任务】中输入【explorer.exe】回车即可。
- echo 或依次执行【新任务】【浏览】【%SYSTEMROOT%\explorer.exe】。
- echo; —————————————————————————————————————
- echo.
- for %%a in (7 XP) do wmic os get caption|findstr /i /c:"Microsoft Windows %%a">nul&&set WinOS=%%a
- echo.
- set Randomed=%random%
- title %Randomed%
- if /i %WinOS%==XP set "SystemProcess=System smss.exe csrss.exe winlogon.exe services.exe lsass.exe svchost.exe conime.exe explorer.exe wmiprvse.exe Userinit.exe taskkill.exe spoolsv.exe ctfmon.exe alg.exe tasklist.exe findstr.exe"
- if %WinOS%==7 set "SystemProcess=System smss.exe csrss.exe winlogon.exe services.exe lsass.exe svchost.exe conime.exe explorer.exe wmiprvse.exe Userinit.exe taskkill.exe spoolsv.exe ctfmon.exe alg.exe tasklist.exe findstr.exe wininit.exe lsm.exe conhost.exe dwm.exe WUDFHost.exe audiodg.exe"&set Randomed=管理员: %Randomed%
- taskkill /f /im explorer.exe
- for /f "skip=3 tokens=2" %%i in ('TASKLIST /FI "WINDOWTITLE eq %Randomed%" /FI "STATUS eq running"') do (
- for /f "skip=3 tokens=1,2" %%a in ('tasklist^|findstr /i /v "%SystemProcess%"') do (
- if /i "%%a"=="cmd.exe" (if "%%~b" neq "%%~i" taskkill /f /t /pid %%b) else taskkill /f /t /pid %%b
- )
- )
- taskkill /f /t /im findstr.exe
- start %windir%\explorer.exe
- echo.&echo.
- echo 一键清理系统垃圾
- 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%\*.tmp
- 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 /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
- del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
- del /f /s /q "%userprofile%\recent\*.*"
- echo.&echo.
- echo 一键清理自启动项
- echo; —————————————————————————————————————
- (reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f)||(for /f "skip=4 tokens=1" %%a in ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run') do reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v %%a /f)
- (reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /va /f)||(for /f "skip=4 tokens=1" %%a in ('reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run') do reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v %%a /f)
- reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v ctfmon.exe /d %SYSTEMROOT%\system32\ctfmon.exe /f
- del "%ALLUSERSPROFILE%\「开始」菜单\程序\启动\*.*" /q /f
- del "%USERPROFILE%\「开始」菜单\程序\启动\*.*" /q /f
- del "%SYSTEMDRIVE%\Docume~1\Default User\「开始」菜单\程序\启动\*.*" /q /f
- del "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\*.*" /q /f
- del "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\*.*" /q /f
- echo.&echo.
- echo 一键清理计划任务
- echo; —————————————————————————————————————
- at /delete /yes||SCHTASKS /Delete /TN * /F
- del /f /q /a %SYSTEMROOT%\Tasks
- echo.&echo.
- echo 清理完毕,自动退出!
- echo.
- ping /n 3 127.0.1>nul
- goto :eof
复制代码
|