I am trying to use the wScript object in my ASP.NET page to trigger a scheduled task on a server on the network. I am able to accomplish this locally however, when I publish the page onto the web server I get nothing. Here's what I have so far...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim wshell As Object
wshell = CreateObject("WScript.Shell")
wshell.run("cmd /c schtasks.exe /run /s server2 /tn AM")
wshell = Nothing
When a user clicks on this button the command schtasks.exe is executed on the web server which triggers the scheduled task on server2. Again, it works fine locally, but when I publish it on the webserver the only thing I see happening on the web server is in the taskmanager the process schtasks.exe is running, but the command is not passing through to server2. I know the cammand works because when I open a command window on the web server and type it in, I can see the execution on server2.