M
MMilkin
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);
}
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);
}