On Windows 7, I have a Java Application, which can start other JAR-s (which are running in background).
In this Application, I have a button, which shoul represent the CTRL+C command for every other started (and still running) JAR-s. I have found this code, which should kill the task by PID (6272):
taskkill /F /PID 6272
But if I run this code on a command propmt, a lot of times it is just waiting, and than return false, so it cannot kill the program. Sometimes it can kill, sometimes it cannot.
I would need a command, which is similar to CTRL+C, because if you hit this CTRL+C, the actual process will end immediately, without waiting!
Could anyone help me please? Thank you!