import java.io.*;
class cmdEx
{
public static void main(String[] arg)
{
String str;
Process p;
BufferedReader in;
try
{
p = Runtime.getRuntime().exec("/bin/ls -aFl");
in = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((str = in.readLine()) != null)
{
System.out.println(str);
}
}
catch (IOException e)
{ System.out.println(e.toString()); }
}
}
message
c:\>java cmdEx
Error
java.io.IOException :CreateProcess :/bin/ls-aFl error=3
this can run p=Runtime.getRuntime().exec("java"); its working
but p=Runtime.getRuntime().exec("dir /p"); from windows.
again display the error
java.io.IOException :CreateProcess
ir /p error=3