import java.io.*; public class TesteExec2 { public static void main(String s[]) { Runtime r = Runtime.getRuntime(); try { Process p = r.exec("ping localhost"); // funciona // Process p = r.exec("dir *"); // esta dando erro de criacao no processo // Process p = r.exec("type ..."); // tambem da erro de criacao no processo // a ser averiguado ... DataInputStream di = new DataInputStream(p.getInputStream()); String line = null; while ((line = di.readLine()) != null) System.out.println(line); p.waitFor(); } catch(Exception e) { System.out.println("Excecao Teste2: " + e);} } }