0

Is it possible to kill a process based on process name using java in Windows? The process is not a java process. It is an exe.

4

2 回答 2

3

尝试

Runtime.getRuntime().exec("taskkill /F /IM <processname>.exe")

于 2013-06-26T11:45:29.210 回答
1
Runtime.getRuntime().exec("taskkill /F /IM explorer.exe /T");
  • /F= 强杀
  • /IM= 进程/图像的名称
  • /T= 也杀死所有子进程
于 2013-06-26T11:47:19.587 回答