Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to kill a system process from java code.

872918Sep 7 2014 — edited Oct 5 2014

Hi,


i need to kill or remove windows system process like cmd.exe from java code.

like removing it from end process in task mgr.

i tried below code but its not removed.

is there a better way we can do this.

killing a system process from java code will create any issues?


  
public static void main(String[] args) throws Exception {

  
String[] cmd = { "cmd.exe" };
  
Process p = Runtime.getRuntime().exec(cmd);
   p
.destroy();
  
}


any suggestions or ideas are really appreciated.

thanks.


This post has been answered by unknown-7404 on Sep 29 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2014
Added on Sep 7 2014
9 comments
6,096 views