I have a batch script that takes as a parameter the source to an image and outputs the image modified. Can I place the batch on a server and call it by means of a webservice?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get you started, here is some information and pointers to different alternatives. Try them and see which one more closely solves your requirements and work for you.
The simplest, just invoke Process.Start() passing the full filespec to the batch file
If you need more control, you might create a Process.StartInfo and pass it to the Process.Start method. I have not tested this code.
A little bit more convoluted way is running a CMD and sending commands to it. See this article http://codebetter.com/brendantompkins/2004/05/13/run-a-bat-file-from-asp-net/
However, this is a pretty rough and brute force batch execution, that may not work for all BAT files (for example those that have FOR commands with %% variables) and have some side effects.