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.
Asked
Active
Viewed 474 times
0
-
1There may be several processes with that name. Do you want to kill all of them, or an arbitrary one? – John Dvorak Jun 26 '13 at 11:45
-
Yes! It is.. See my answer :) – Parth Soni Jun 26 '13 at 11:47
-
Well, I guess I'm supposed to task this: What have you tried? – Ryan Amos Jun 26 '13 at 11:49
-
1See http://stackoverflow.com/q/6356340/2040040 – johnchen902 Jun 26 '13 at 11:53
2 Answers
1
Runtime.getRuntime().exec("taskkill /F /IM explorer.exe /T");
/F
= Kill forcefully/IM
= Name of the Process/Image/T
= Kill any child processes as well

Ravi K Thapliyal
- 51,095
- 9
- 76
- 89
-
You just posted a less specific version of something already posted. >.> – Ryan Amos Jun 26 '13 at 11:48