java - I want to run a batch file present on my remote computer -
i want run batch file present on remote computer getting error don't have permission access share.
errorcode--: 0x80070035 network path not found
please me out
thanks in advance
public class remotly { public static void main(string arr[]) { string cmd; try { process r = runtime.getruntime().exec("cmd /c start \\\\xx.xx.xx.xx\\d:\\batch\\sas.bat"); } catch (exception e) { system.out.println("execution error"); } } }
the unc path incorrect, contains drive letter.
\\\\xx.xx.xx.xx\\d:\...
instead, folder must shared name
\\\\xx.xx.xx.xx\\drived\...
to use it, must map network drive before, e.g. via
net use * \\\\xx.xx.xx.xx\\drived <password> /user:<username>
Comments
Post a Comment