VBScript: When You Can't Use Powershell to Ping a Webpage...
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.
1Call pingPage("https://www.domain.com")
2
3Function pingPage(strURL)
4 Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
5
6 objXMLHTTP.Open "GET", strURL, False
7 objXMLHTTP.Send()
8
9 If objXMLHTTP.Status <> 200 Then
10 'email someone about it
11 End If
12
13 Set objXMLHTTP = Nothing
14End Function
On a related note: the PowerShell line looks something like this: $pingPage = (new-object net.webclient).DownloadString("https://www.domain.com")