Sometimes, there’s a need to schedule a “ping” to a webpage (that needs to be pre-compiled, for instance). While using PowerShell is the easiest way to do this, it’s not always available on older server, while VBScript is nearly always a safe bet. The biggest issue with using VBScript or the command line is what to do with the window it may open. Instead of using iexplore and taskkill, using the following VBScript is my fav alternative.
Function pingPage (strURL)
Set objXMLHTTP = CreateObject(“MSXML2.XMLHTTP”)
objXMLHTTP.open “GET”, strURL, false
If objXMLHTTP.Status <> 200 Then
’email someone about it
Set objXMLHTTP = Nothing
On a related note: the PowerShell line looks something like this: $pingPage = (new-object net.webclient).DownloadString(“http://www.domain.com”)