Tente escrever cmd /C dir c:

 

 

Nilton Ant�nio Grob�rio J�nior
Desenvolvedor Java

Rua Afr�nio de Melo Franco -333
Quitandinha - Petr�polis - RJ
CEP 25.651-000 - BRASIL

www.cilix.com.br
Tel. (+55 24) 3096 9306
Fax. (+55 24) 3096 9306
----- Original Message -----
Sent: Monday, March 24, 2003 12:47 PM
Subject: [java-list] Runtime !!!!

 
Estou tentando executar um "dir" do DOS em um programa java....
 
No c�digo tenho a seguinte linha:
Runtime.getRuntime().exec("dir");
 
A sa�da me retorna o seguinte erro.
 
java.io.IOException: CreateProcess: dir error=2
 at java.lang.Win32Process.create(Native Method)
 at java.lang.Win32Process.<init>(Win32Process.java:66)
 at java.lang.Runtime.execInternal(Native Method)
 at java.lang.Runtime.exec(Runtime.java:551)
 at java.lang.Runtime.exec(Runtime.java:418)
 at java.lang.Runtime.exec(Runtime.java:361)
 at java.lang.Runtime.exec(Runtime.java:325)
 
Algu�m saberia dizer o que tem de errado...
Obrigado..
M�rio

<<lo_cilix.jpg>>

Responder a