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?
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?
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.