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
  • 1
    There may be several processes with that name. Do you want to kill all of them, or an arbitrary one? Commented Jun 26, 2013 at 11:45
  • Yes! It is.. See my answer :) Commented Jun 26, 2013 at 11:47
  • Well, I guess I'm supposed to task this: What have you tried? Commented Jun 26, 2013 at 11:49
  • 1
    See stackoverflow.com/q/6356340/2040040 Commented Jun 26, 2013 at 11:53

2 Answers 2

3

TRY

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

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

You just posted a less specific version of something already posted. >.>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.