I have a asp.net web site, I would like a page on that site to be able to invoke a Windows Scheduled task or a batch file on a server different to the IIS server?
Is it possible?
How should I do this?
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.
Simplest way would be to place a Web Service on the server that needs to run the scheduled task/batch file (we’ll call this SERVER1). That service should have a method that will invoke the scheduled task/batch file (we’ll call this method Invoke).
Then from the asp.net web site on the other server (SERVER2), we’ll add a link to run our method on SERVER1, http://SERVER1/YourWebService.asmx/Invoke.
To me this would be the easiest way to manipulate SERVER1 from an outside entity (In your case an asp.net web site).
Note: You may run into security issues with your Web Service invoking scheduled tasks and running batch files. I believe it can be done, but you may need to play with your .Net permission settings.