这篇文章将为大家详细讲解有关如何使用bat清理开机启动项,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
代码如下:
@echo off&setlocal enabledelayedexpansionmode con cols=61 lines=25&color f5mshta vbscript:msgbox("在运行程序前,请确认所有编辑资料已经保存",,"自制优化系统")(window.close)if exist tem.txt del /f /q tem.txtecho.正在刷选进程.............echo>>tem.txt explorer.exeecho>>tem.txt System Idle Processecho>>tem.txt Systemecho>>tem.txt smss.exeecho>>tem.txt csrss.exeecho>>tem.txt winlogon.exeecho>>tem.txt services.exeecho>>tem.txt TheWorld.exeecho>>tem.txt lsass.exeecho>>tem.txt svchost.exeecho>>tem.txt spoolsv.exeecho>>tem.txt alg.exeecho>>tem.txt ctfmon.exeecho>>tem.txt ekrn.exeecho>>tem.txt wdfmgr.exeecho>>tem.txt 360tray.exeecho>>tem.txt egui.exeecho>>tem.txt wmiprvse.exeecho>>tem.txt QQ.exeecho>>tem.txt cmd.exeecho>>tem.txt IEXPLORE.EXEecho>>tem.txt TXPlatform.exeecho>>tem.txt tasklist.exeecho>>tem.txt conime.exeecho>>tem.txt safeboxTray.exeecho>>tem.txt Thunder5.exeecho>>tem.txt tudouva.exefor /f "eol= tokens=1,2 delims=," %%i in ('tasklist /nh /fo csv') do (findstr /i /x %%i tem.txt >nulif 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\runREG EXPORT "HKCU\%key%" a.reg /nt4>nulecho REGEDIT4 >b.regecho [HKEY_CURRENT_USER\%key%] >>b.regfor /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.regREG EXPORT "HKLM\%key%" a.reg /nt4>nulecho REGEDIT4 >b.regecho [HKEY_LOCAL_MACHINE\%key%] >>b.regfor /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.regdel /q a.reg del /q b.regdel tem.txtecho 已经优化好echo ======================================echo == ==echo ======================================echo 清理部分系统垃圾del /f /q %systemdrive%\*.tmp>nul 2>nuldel /f /q %systemdrive%\*._mp>nul 2>nuldel /f /q %systemdrive%\*.log>nul 2>nuldel /f /q %systemdrive%\*.gid>nul 2>nuldel /f /q %systemdrive%\*.chk>nul 2>nuldel /f /q %systemdrive%\*.old>nul 2>nuldel /f /q %windir%\*.bak>nul 2>nuldel /f /q %windir%\*.tmp>nul 2>nuldel /f /q %windir%\prefetch\*.*>nul 2>nuldel /f /s /q %systemdrive%\recycled\*.*>nul 2>nuldel /f /q "%ALLUSERSPROFILE%\Documents\DrWatson\*.*">nul 2>nuldel /f /q "%USERPROFILE%\Cookies\*.txt">nul 2>nuldel /f /q /s "%TEMP%\*.*">nul 2>nuldel /f /q /s "%Systemroot%\Prefetch\*.*">nul 2>nuldel /f /q "%USERPROFILE%\Recent\*.*">nul 2>nuldel /f /q "%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.lnk">nul 2>nuldel /f /q /s "%USERPROFILE%\Local Settings\Temp\*.*">nul 2>nulrd /s /q %windir%\temp & md %windir%\temp>nul 2>nulif not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.*>nul 2>nuldel /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul 2>nulecho 已经清理了mshta vbscript:msgbox("everything done!!",,"完成信息")(window.close)taskkill /f /im cmd.exe
关于“如何使用bat清理开机启动项”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。