hello friends,
I am running one _ant_compile.cmd through a java program,this is how i have done it,
File file=new File (path)//path is a parameter passed in
Runtime rt=Runtime.getRuntime();
Process pr= rt.exec (" rundll32 SHELL32.DLL,ShellExec_RunDLL " + file.getAbsolutePath());
so, as expected the _ant_compile.cmd gets executed, but after it's done before closing the console window it says "press any key to close" and requires the user to press a key. my problem is that....I need to get rid of that part and let it close anyways. so since I cannot meddle with the _ant_compile.cmd file I have to get the key pressed when that message comes up, without the interaction of the user. So I thought of getting the output of the process to a String variable and cheking for the necessary line in order to fire the button press action... how to get the process output to a String (or even maybe write to a file)??