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.
Joined: Sep 23, 2003
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?
Joined: Apr 07, 2007
Sorry, I can't say I'm familiar with any -- good luck!
subject: What's the best to remote execute Windows Batch?