Killing a process with taskkill /F returning code 0

Claus picture Claus · Jun 30, 2010 · Viewed 10.7k times · Source

I need to kill a windows process (java.exe). I'm currently using:

taskkill.exe /F /IM java.exe

I need to use the /F option since is a critical process,but in this way I get a return code 1 instead I need a return code 0 (returned when I don't use /F for killing other not critical processes)

how could I fix this problem?

Many thanks

Answer

Venkat picture Venkat · Jul 3, 2010

You can try with :

TASKKILL /F /IM "notepad.exe"

You can know more here. Visit this blog too.