Hi!
I'm start application for my program.
start code:
import java.io.*; public class runtime{ public static void main(String args[]) { try { Runtime rt = Runtime.getRuntime(); //Process pr = rt.exec("cmd /c dir"); //Process pr = rt.exec("cmd /c tasklist"); Process pr = rt.exec("cmd /c start /MIN D:/program/program.exe"); //Process pr = rt.exec("c:\helloworld.exe"); BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream())); String line=null; while((line=input.readLine()) != null) { System.out.println(line); } int exitVal = pr.waitFor(); System.out.println("Exited with error code "+exitVal); } catch(Exception e) { System.out.println(e.toString()); e.printStackTrace(); } } }
But what is killing program?
How to return application pid?
(some application same name)
(example: notepad.exe (pid 998) (runned)
new--> notepad.exe (pid 999)
(the return pid i save the file first a row.)
how to return actual application pid?
Sorry, but i dont know english. (im from hungary).
Thank you for your helping.
Prepared91