代码如下:
@echooff&setlocalenabledelayedexpansion
modeconcols=61lines=25&colorf5
mshtavbscript:msgbox("在运行程序前,请确认所有编辑资料已经保存",,"自制优化系统")(window.close)
ifexisttem.txtdel/f/qtem.txt
echo.正在刷选进程.............
echo>>tem.txtexplorer.exe
echo>>tem.txtSystemIdleProcess
echo>>tem.txtSystem
echo>>tem.txtsmss.exe
echo>>tem.txtcsrss.exe
echo>>tem.txtwinlogon.exe
echo>>tem.txtservices.exe
echo>>tem.txtTheWorld.exe
echo>>tem.txtlsass.exe
echo>>tem.txtsvchost.exe
echo>>tem.txtspoolsv.exe
echo>>tem.txtalg.exe
echo>>tem.txtctfmon.exe
echo>>tem.txtekrn.exe
echo>>tem.txtwdfmgr.exe
echo>>tem.txt360tray.exe
echo>>tem.txtegui.exe
echo>>tem.txtwmiprvse.exe
echo>>tem.txtQQ.exe
echo>>tem.txtcmd.exe
echo>>tem.txtIEXPLORE.EXE
echo>>tem.txtTXPlatform.exe
echo>>tem.txttasklist.exe
echo>>tem.txtconime.exe
echo>>tem.txtsafeboxTray.exe
echo>>tem.txtThunder5.exe
echo>>tem.txttudouva.exe
for/f"eol=tokens=1,2delims=,"%%iin('tasklist/nh/focsv')do(
findstr/i/x%%item.txt>nul
iferrorlevel1(
taskkill/f/pid%%j1>nul2>nul
)
)
deltem.txt&echo结束进程任务基本完成
echo======================================
echo====
echo======================================
echo优化开机启动项
del/f/s/q"%systemdrive%\Docume~1\AllUsers\「开始」菜单\程序\启动\*.*"
del/f/s/q"%userprofile%\「开始」菜单\程序\启动\*.*"
for/f"delims=\"%%jin('fsutilfsinfodrives^|find/v""')do(
del/f/q"%%j\*.inf">nul2>nul&del/f/q/ah"%%j\*.exe"2>nul
)
echo>>tem.txt"egui"
echo>>tem.txt"essact"
echo>>tem.txt"CTFMON.EXE"
setkey=Software\Microsoft\Windows\CurrentVersion\run
REGEXPORT"HKCU\%key%"a.reg/nt4>nul
echoREGEDIT4>b.reg
echo[HKEY_CURRENT_USER\%key%]>>b.reg
for/f"skip=2eol=[tokens=1,2delims=="%%ain(a.reg)do(
findstr/i%%atem.txt>nul||echo%%a=->>b.reg
)
for/f"skip=2delims=["%%min('find/i"\run\"a.reg')do(
echo^[^-%%m>>b.reg
)
regedit/sb.reg
REGEXPORT"HKLM\%key%"a.reg/nt4>nul
echoREGEDIT4>b.reg
echo[HKEY_LOCAL_MACHINE\%key%]>>b.reg
for/f"skip=2eol=[tokens=1,2delims=="%%ain(a.reg)do(
findstr/i%%atem.txt>nul||echo%%a=->>b.reg
)
for/f"skip=2delims=["%%min('find/i"\run\"a.reg')do(
echo^[^-%%m>>b.reg
)
regedit/sb.reg
del/qa.reg
del/qb.reg
deltem.txt
echo已经优化好
echo======================================
echo====
echo======================================
echo清理部分系统垃圾
del/f/q%systemdrive%\*.tmp>nul2>nul
del/f/q%systemdrive%\*._mp>nul2>nul
del/f/q%systemdrive%\*.log>nul2>nul
del/f/q%systemdrive%\*.gid>nul2>nul
del/f/q%systemdrive%\*.chk>nul2>nul
del/f/q%systemdrive%\*.old>nul2>nul
del/f/q%windir%\*.bak>nul2>nul
del/f/q%windir%\*.tmp>nul2>nul
del/f/q%windir%\prefetch\*.*>nul2>nul
del/f/s/q%systemdrive%\recycled\*.*>nul2>nul
del/f/q"%ALLUSERSPROFILE%\Documents\DrWatson\*.*">nul2>nul
del/f/q"%USERPROFILE%\Cookies\*.txt">nul2>nul
del/f/q/s"%TEMP%\*.*">nul2>nul
del/f/q/s"%Systemroot%\Prefetch\*.*">nul2>nul
del/f/q"%USERPROFILE%\Recent\*.*">nul2>nul
del/f/q"%USERPROFILE%\ApplicationData\Microsoft\Office\Recent\*.lnk">nul2>nul
del/f/q/s"%USERPROFILE%\LocalSettings\Temp\*.*">nul2>nul
rd/s/q%windir%\temp&md%windir%\temp>nul2>nul
ifnotexist%SystemRoot%\Minidump\NULdel/f/q/s%SystemRoot%\Minidump\*.*>nul2>nul
del/f/s/q"%userprofile%\LocalSettings\TemporaryInternetFiles\*.*">nul2>nul
echo已经清理了
mshtavbscript:msgbox("everythingdone!!",,"完成信息")(window.close)
taskkill/f/imcmd.exe
更多信息请查看IT技术专栏