本帖最后由 zaqmlp 于 2019-5-18 16:47 编辑
- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- set "父进程=aa1.exe"
- set "子进程=xxx.exe"
- for /f %%a in ('wmic Process where "Name='%父进程%'" get ProcessId /value^|find "="') do set %%a
- if not defined ProcessId (echo;ParentProcess is not found&goto end)
- echo;父进程ID=%ProcessId%
- for /f "skip=1" %%a in ('wmic Process where "Name='%子进程%' and ParentProcessId='%ProcessId%'" get ProcessId^|findstr "[0-9]"') do (
- echo;子进程ID=%%a
- taskkill /f /pid %%a /t
- )
- :end
- echo;%info%
- pause
复制代码
|