• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Kill Task Manager external programs using Java  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I written like this but it is not killing my Task Manager process.

EA_PDT~1.EXE this is running in my task manager i need to kill now using java.I executed below code but it is not killing my process in task manager.
try
{
Process p = Runtime.getRuntime().exec("EA_PDT~1.EXE");
p.destroy();
}
catch (Exception e)
{
e.printStackTrace();
}

Please any body help me

regards
kumar
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Naveen Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Any please help me.
THis is urgent to me.

regards
kumar
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you are asking... You started a program in Java that you want killed? Or you have a program that is running, that you want killed? From what you are asking, it seems to be the later, but your code seems to suggest the prior.

In any case, you could also look into the "tasklist" and "taskkill" commands. The first command will return a list of running programs, similar to the output from task manager, and the second will kill a particular program.

These programs are command line programs, so hence, can be called from Runtime.exec().

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!