求大虾:给我写个批量关闭(除系统必须的)进程.bat 其他的进程全都关闭! 谢谢勒!

2025-01-06 02:54:11
推荐回答(2个)
回答1:

@echo off
echo System>1w.txt
echo smss.exe>>1w.txt
echo csrss.exe>>1w.txt
echo winlogon.exe>>1w.txt
echo services.exe>>1w.txt
echo lsass.exe>>1w.txt
echo svchost.exe>>1w.txt
echo alg.exe>>1w.txt
echo dllhost.exe>>1w.txt
echo explorer.exe>>1w.txt
echo ctfmon.exe>>1w.txt
echo conime.exe>>1w.txt
echo wmiprvse.exe>>1w.txt
echo dllhost.exe>>1w.txt
echo wuauclt.exe>>1w.txt
echo notepad.exe>>1w.txt
echo tasklist.exe>>1w.txt
echo cmd.exe>>1w.txt

for /f "tokens=1 delims=," %%i in ('tasklist /nh /FO CSV') do (
find /i %%i "1w.txt">nul
if errorlevel 1 taskkill /f /im %%i >nul
)
pause

回答2:

你试试吧,系统必须的进程你想杀也杀不掉,至少用taskkill杀不掉。
@echo off
for /f "skip=2 tokens=2" %%i in ('tasklist') do taskkill /f /pid %%i