Java : Running executables

Created 03 February 2003 00:00
try {     
  Runtime r = Runtime.getRuntime();
  Process p = r.exec("code.exe");
  InputStream in = p.getInputStream();               
  BufferedReader br = new BufferedReader(new InputStreamReader(in));                         
  while (true) {
    String str = br.readLine();
    if (str == null) break;
    System.out.println(str);
  }                         
}
catch ( Exception ee) {
  ee.printStackTrace();
}