Why does this VBS scheduled task (to call a URL) not work in Windows Server 2008?
- by user303644
This same script worked in older server OS environments, and even on my desktop; and allows me to kick off a nightly process on my website's URL. It simply will not execute the URL in my Windows Server 2008 environment.
It does not generate any errors, claiming task completion
I can pull the same URL up just fine in the server's web browser
I have the script running with "highest privileges"
I even tried to create a batch file which executes it, so I can explicitly "Run as Administrator" and it still will not execute the URL (but will not generate any errors either).
I'm baffled as to why the task claims to have completed successfully, yet the script never reaches the URL.
Call LogEntry()
Sub LogEntry()
'Force the script to finish on an error.
On Error Resume Next
'Declare variables
Dim objRequest
Dim URL
Set objRequest = CreateObject("MSXML2.ServerXMLHTTP")
'Put together the URL link appending the Variables.
URL = "http://myURL/AutorunNightlyTasks.aspx"
'Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL, False
'Send the HTML Request
objRequest.send()
'Set the object to nothing
Set objRequest = Nothing
End Sub