终止指定PID的进程,不必先 tasklist 之后再终止,直接用 taskkill /pid 就可以了,演示代码如下:
@echo off
taskkill /pid 132>nul 2>nul&& echo PID为132的进程已经被终止||echo PID为132的进程不存在
pause
Terminate the process with the specified PID. You don't need to first use tasklist and then terminate it; you can directly use taskkill /pid. The demonstration code is as follows:
@echo off
taskkill /pid 132>nul 2>nul&& echo The process with PID 132 has been terminated||echo The process with PID 132 does not exist
pause