Tastybrownies
Tastybrownies

Reputation: 937

Run batch file on remote computer inside Java program

I have a program right now that uses the "net use" command to access a shared drive on a network computer at my work. This works fabulously and I'm able to copy a file from the remote machine onto my own using the FileUtil library from apache. Now I'm wanting to run batch file located on the remote machine and I want it executed in that environment not my own local machine. At first I thought I could just use the "net use" command again with no problem but when I execute the batch file, it is run on my own machine not the remote one. However, this is not what I want to happen.

So, is anyone familiar with this process of executing batch files on remote machines. Better yet, from inside Java.

Thank you for any feed back I greatly appreciate it!

Upvotes: 0

Views: 981

Answers (1)

LogoS
LogoS

Reputation: 313

I don't know much about java but can you execute external programs from it? If the answer is "yes" you might try with PSEXEC from Sysinternals it runs every kind of things remotely.

Upvotes: 1

Related Questions