0

when I type taskkill /f /t /pid xxx in Command Prompt, my process tree ends correctly. However, the code block below written in Java ends all processes in my process tree except one of them. Could you help me?

String pid = getPidWithSomeWay();
ProcessBuilder pb1 = new ProcessBuilder("cmd.exe","/c","taskkill /f /t /pid " + pid);
Process p1 = pb1.start();

Also, I tried ending process tree implementation with ProcessHandle, but I am facing the same problem.

0 Answers0