aspose file tools*
The moose likes Distributed Java and the fly likes What's the best to remote execute Windows Batch? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "What Watch "What New topic
Author

What's the best to remote execute Windows Batch?

Tony Tranquil
Greenhorn

Joined: Sep 23, 2003
Posts: 24
My Web-App is running on the *nix box, this app needs to execute Window Batch remotely. Could you please let me know what's the best way to do it?

Thank you in advance
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Tony,

If you can, a good way to do this would be to run a process on the same machine as the windows batch file that accepts incoming requests to execute it. This could receive requests over any sort of network protocol - tcp, udp, soap, etc. Then this application would receive a request from your web app, and it would execute the batch file locally. This separates your webapp's request code from knowing the details that it is executing a batch file -- it is just sending a network request to do something. This will help with testability and also allow you to expand in the future. For example, you could change so it is not a batch file, but some other process executing and your webapp would never even know.

Jeff
Tony Tranquil
Greenhorn

Joined: Sep 23, 2003
Posts: 24
Thank Jeff!

I did some research. As we've know there are some utility libraries like j2ssh/jsh/jrexec, these libraries provides functionalities like telnet to UNIX box. I'd like to know if there is any libraries for *NIX to 'TELNET' Windows box?

Thanks
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Sorry, I can't say I'm familiar with any -- good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the best to remote execute Windows Batch?
 
Similar Threads
how to use execute batch
JDBC for loading data into SQL Server
With respect to Batch execution in JDBC
Using Runtime.exec in a web application
Using Connection Pool question again