2017-07-14 54 views

回答

1

使用tasklist命令的过滤器:

@echo off 


for /f "skip=3 tokens=2 delims= " %%a in ('tasklist /fi "imagename eq OPCExplorer.exe" /fi "PID ne 8888"') do (
    taskkill /pid %%a /f 
) 
1

你可以使用内置的WMIC.exe

WMIC Process Where "Name='OPCExplorer.exe' And Not ProcessId='8888'" Call Terminate