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