import java.io.*; public class Example { public static void ExecuteCommand (String ExternCommand) throws IOException { char c; Process proc = Runtime.getRuntime().exec("start command /c " + ExternCommand + " >output.txt"); try { proc.waitFor(); } catch (InterruptedException e) { System.out.println("InterruptedException raised: "+e.getMessage()); } InputStream f = new FileInputStream ("output.txt"); while ((c=(char)f.read())!=(char)-1) System.out.print(c); } public static void main (String args[]) throws IOException { String ExternCommand = new String(); for (int k=0;k