java - Why am I getting a "Path not correct" error while running a batch file on a remote system? -


I need to run a batch file from a local machine on a remote system. Using the code given below, Getting the error:

  The path is not correct  

I have the IP address of the machine, and I have a batch file with the name of the public share and the share DSC .

The machine's IP address is 16.181.37.28.

This is my code. I know that the path is wrong how can I give the exact path?

  / * * To change this template, choose Tools * Templates and open the template in the editor. * / / ** * * * @ Author padmaja * / import java.io. *; Class Test {public static void main (String ARG []) {try {String command = "cmd / c 16.181.37.28/dsc/StartVisTsDataCenterMySql-log.bat"; Runtime RT = runtime.gettime (); Process pr = rt.exec (command); } Hold (IOException e) {e.printStackTrace (); }}}  

Are you trying to run a script on a remote machine or local machine? Your approach reads the file from a remote machine, but it runs on your locality.

To get something that is running on a remote machine, there is a process running on a remote machine in a normal way that runs permanently and listen to the requests. If any request arrives, your batch file will start which you want to run.


Comments