Home All Groups Group Topic Archive Search About

How to check whether the server is up in VBScript



Author
18 Apr 2007 7:16 AM
Jerry
Please do tell me how to check whther the url or the webserver is up and
running using VBScript

Thanks,
Jerry

Author
19 Apr 2007 2:13 AM
Marty List
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

AddThis Social Bookmark Button