Hi i used the logic of yours... but i am getting the error
C:\Socket>java Serial dir
Exception in thread "main" java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at Serial.main(Serial.java:9)
My program...
import java.lang.*;
import java.io.*;
public class Serial{
public static void main(String args[])throws IOException{
Runtime object= Runtime.getRuntime();
Process p=null;
p=object.exec(args[0]);
}
}