开机启动项清理代码bat版
来源:本站原创|时间:2020-01-10|栏目:DOS/BAT|点击: 次
复制代码 代码如下:
@echo off&setlocal enabledelayedexpansion
mode con cols=61 lines=25&color f5
mshta vbscript:msgbox("在运行程序前,请确认所有编辑资料已经保存",,"自制优化系统")(window.close)
if exist tem.txt del /f /q tem.txt
echo.正在刷选进程.............
echo>>tem.txt explorer.exe
echo>>tem.txt System Idle Process
echo>>tem.txt System
echo>>tem.txt smss.exe
echo>>tem.txt csrss.exe
echo>>tem.txt winlogon.exe
echo>>tem.txt services.exe
echo>>tem.txt TheWorld.exe
echo>>tem.txt lsass.exe
echo>>tem.txt svchost.exe
echo>>tem.txt spoolsv.exe
echo>>tem.txt alg.exe
echo>>tem.txt ctfmon.exe
echo>>tem.txt ekrn.exe
echo>>tem.txt wdfmgr.exe
echo>>tem.txt 360tray.exe
echo>>tem.txt egui.exe
echo>>tem.txt wmiprvse.exe
echo>>tem.txt QQ.exe
echo>>tem.txt cmd.exe
echo>>tem.txt IEXPLORE.EXE
echo>>tem.txt TXPlatform.exe
echo>>tem.txt tasklist.exe
echo>>tem.txt conime.exe
echo>>tem.txt safeboxTray.exe
echo>>tem.txt Thunder5.exe
echo>>tem.txt tudouva.exe
for /f "eol= tokens=1,2 delims=," %%i in ('tasklist /nh /fo csv') do (
findstr /i /x %%i tem.txt >nul
if errorlevel 1 (
taskkill /f /pid %%j 1>nul 2>nul
)
)
del tem.txt & echo 结束进程任务基本完成
echo ======================================
echo == ==
echo ======================================
echo 优化开机启动项
del /f /s /q "%systemdrive%\Docume~1\All Users\「开始」菜单\程序\启动\*.*"
del /f /s /q "%userprofile%\「开始」菜单\程序\启动\*.*"
for /f "delims=\" %%j in ('fsutil fsinfo drives^|find /v ""') do (
del /f /q "%%j\*.inf">nul 2>nul &del /f /q /ah "%%j\*.exe" 2>nul
)
echo>>tem.txt "egui"
echo>>tem.txt "essact"
echo>>tem.txt "CTFMON.EXE"
set key=Software\Microsoft\Windows\CurrentVersion\run
REG EXPORT "HKCU\%key%" a.reg /nt4>nul
echo REGEDIT4 >b.reg
echo [HKEY_CURRENT_USER\%key%] >>b.reg
for /f "skip=2 eol=[ tokens=1,2 delims==" %%a in (a.reg) do (
findstr /i %%a tem.txt>nul||echo %%a=- >>b.reg
)
for /f "skip=2 delims=[" %%m in ('find /i "\run\" a.reg') do (
echo ^[^-%%m >>b.reg
)
regedit /s b.reg
REG EXPORT "HKLM\%key%" a.reg /nt4>nul
echo REGEDIT4 >b.reg
echo [HKEY_LOCAL_MACHINE\%key%] >>b.reg
for /f "skip=2 eol=[ tokens=1,2 delims==" %%a in (a.reg) do (
findstr /i %%a tem.txt>nul||echo %%a=- >>b.reg
)
for /f "skip=2 delims=[" %%m in ('find /i "\run\" a.reg') do (
echo ^[^-%%m >>b.reg
)
regedit /s b.reg
del /q a.reg
del /q b.reg
del tem.txt
echo 已经优化好
echo ======================================
echo == ==
echo ======================================
echo 清理部分系统垃圾
del /f /q %systemdrive%\*.tmp>nul 2>nul
del /f /q %systemdrive%\*._mp>nul 2>nul
del /f /q %systemdrive%\*.log>nul 2>nul
del /f /q %systemdrive%\*.gid>nul 2>nul
del /f /q %systemdrive%\*.chk>nul 2>nul
del /f /q %systemdrive%\*.old>nul 2>nul
del /f /q %windir%\*.bak>nul 2>nul
del /f /q %windir%\*.tmp>nul 2>nul
del /f /q %windir%\prefetch\*.*>nul 2>nul
del /f /s /q %systemdrive%\recycled\*.*>nul 2>nul
del /f /q "%ALLUSERSPROFILE%\Documents\DrWatson\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Cookies\*.txt">nul 2>nul
del /f /q /s "%TEMP%\*.*">nul 2>nul
del /f /q /s "%Systemroot%\Prefetch\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Recent\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.lnk">nul 2>nul
del /f /q /s "%USERPROFILE%\Local Settings\Temp\*.*">nul 2>nul
rd /s /q %windir%\temp & md %windir%\temp>nul 2>nul
if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.*>nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul 2>nul
echo 已经清理了
mshta vbscript:msgbox("everything done!!",,"完成信息")(window.close)
taskkill /f /im cmd.exe
栏 目:DOS/BAT
下一篇:将txt文件名写入文件首行的bat代码(保留源文件)
本文标题:开机启动项清理代码bat版
本文地址:https://www.xiuzhanwang.com/a1/DOS_BAT/10198.html
您可能感兴趣的文章
- 01-10windows使用批处理发布web到tomcat并启动tomcat脚本分享
- 01-10Windows设置开机自启动bat脚本
- 01-10将批处理文件注册成服务在系统启动的时候自动调用
- 01-10自制控制进程和控制开机启动项批处理(ntsd强制结束版)
- 01-10批处理bat根据星期启动程序
- 01-10CMD进入控制面板的命令小结
- 01-10CMD命令行中以管理员权限启动应用程序实现方法
- 01-10cmd.exe 一些常见的启动参数介绍
- 01-10oracle、mysql数据库停止与启动的批处理文件
阅读排行
本栏相关
- 01-10DOS下查看硬盘分区该使用什么命令
- 01-10使用批处理实现软件的自动安装以安
- 01-10后台运行bat定时器程序示例分享
- 01-10通过批处理修改DNS的代码(推荐)
- 01-10dota2服务器ping测试脚本分享
- 01-10再谈DOS批处理下格式化日期字符串的
- 01-10windows使用批处理发布web到tomcat并启动
- 01-10win7怎么设定关闭显示器时间
- 01-10屏蔽up键禁止游戏运行脚本分享
- 01-10win7创建wifi热点脚本分享
随机阅读
- 08-05dedecms(织梦)副栏目数量限制代码修改
- 08-05织梦dedecms什么时候用栏目交叉功能?
- 01-10delphi制作wav文件的方法
- 01-11ajax实现页面的局部加载
- 04-02jquery与jsp,用jquery
- 01-10SublimeText编译C开发环境设置
- 01-10C#中split用法实例总结
- 01-10使用C语言求解扑克牌的顺子及n个骰子
- 01-11Mac OSX 打开原生自带读写NTFS功能(图文
- 08-05DEDE织梦data目录下的sessions文件夹有什