views:

1736

answers:

2

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.

+3  A: 

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 http://hudson.dev.java.net (you'll have to dive into the code)

Tom
Cool, thanks! Where exactly is the code located that is related to remote execution? Or is it all over the codebase?
Ryan
+2  A: 

Check out the Java RDP Client. Not really out of the box, but with little digging you should be able to trim it down to what you need.

Since it uses getopt, I would assume it's GPL'd.

ddimitrov