下面是Process.ini,里面存放不需要结束的进程名,不区分大小写,可自行配置:
csrss.exe
explorer.exe
lsass.exe
smss.exe
services.exe
svchost.exe
winlogon.exe
System
System Idle Process
运行下面的批处理即可:
@echo off&Setlocal EnableDelayedExpansion
for /f "tokens=1 delims=," %%a in ('tasklist /nh /FO CSV') do (
for /f "delims=" %%b in (Process.ini) do (
set /a flag+=1
if /i not %%a=="%%b" set /a num+=1
)
if !flag! equ !num! taskkill /f /im %%a
set /a flag=num=0
)
echo the end...