|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to check whether the server is up in VBScript
Please do tell me how to check whther the url or the webserver is up and
running using VBScript Thanks, Jerry Here's a quick example of how to retrieve a URL from VBScript. Run it from
a command prompt using a command similar to this: CScript.exe filepath\scriptname.vbs http://www.domain.com/ '''''''''''''''''''''''''''''' Option Explicit Dim objSvrHTTP Set objSvrHTTP = CreateObject("Msxml2.XMLHTTP.4.0") objSvrHTTP.open "GET", WScript.Arguments(0), False 'On Error Resume Next objSvrHTTP.send If Err.Number = 0 Then WScript.Echo objSvrHTTP.responseText Else WScript.Echo "Error: " & Hex(Err.Number) End If '''''''''''''''''''''''''''''' Show quote "Jerry" <Je***@discussions.microsoft.com> wrote in message news:967488D3-DC3F-48DB-91F0-D84D401FD8FC@microsoft.com... > Please do tell me how to check whther the url or the webserver is up and > running using VBScript > > Thanks, > Jerry |
|||||||||||||||||||||||