Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to run remote commands on a Windows server from Java?

Are there any existing solutions for remote execution of commands on a windows server from Java natively? psexec.exe is not an option since the java application has to be cross platform.

Even a preexisting solution using Java RM would be sufficient.

Currently, I'm using an SSH client library to ssh through java into a Windows server that's running the cygwin SSH daemon. Sadly the SSH daemon has some issues when it comes to quoting commands that go into a CMD (as opposed to bash) shell.

like image 741
Ryan Avatar asked Dec 13 '25 03:12

Ryan


1 Answers

It'll require some work, but the remoting library in Hudson has very good support for running commands and doing file operations over the network on remote computers.

see https://jenkins.io/projects/remoting/ (you'll have to dive into the code)

like image 93
Tom Avatar answered Dec 14 '25 16:12

Tom