here is my code:
Code:
try {
Runtime r = Runtime.getRuntime();
Process p = r.exec ( "\\\\192.168.185.232" );
}
catch (Exception e) {
e.printStackTrace();
}
when i type "\\192.168.185.232" into the run console of windows, i can access the samba server. but when i execute this code in Java i get an error which says:
java.io.IOException: CreateProcess: \\192.168.185.232 error=123
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
the IP Address is the address of the samba server. alternatively, i can type "\\linuxpdc" in the windows run console ("\\\\linuxpdc" in java) to access the server. "\\\\linuxpdc" gives me the same error as "\\\\192.168.185.232".
why is this so? what should be my argument inside r.exec (String cmd) be to make it work?
btw, the application running this code is in windows. when i replace "\\\\192.18.185.232" with "explorer" or "notepad", etc it works.
thanks in advance!