+ Reply to Thread
Results 1 to 2 of 2

Thread: Check if website is up

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    15

    Check if website is up

    I want to use a function written on vbs to check if website is up and running or not ? , it is like pinging website , when you receive Acknowledge then the website is up and running .
    Thanks in advance

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    41
    For X-HTTP use the below code :
    Code:
    Dim strWebsite
    
     strWebsite = "www.robvanderwoude.com"
    
     If IsWebsiteUp( strWebsite ) Then
         WScript.Echo "Web site " & strWebsite & " is up and running!"
     Else
         WScript.Echo "Web site " & strWebsite & " is down!!!"
     End If
    
    
     Function IsWebsiteUp( myWebsite )
    
         Dim objHTTP
    
         Set objHTTP = CreateObject( "XStandard.HTTP" )
    
         objHTTP.AddRequestHeader "User-Agent", _"Opera/10.0 (compatible; MyApp 1.0; Windows NT 5.1)"
         objHTTP.Get "http://" & myWebsite
    
         If objHTTP.ResponseCode = 200 Then
             IsWebsiteUp = True
         Else
             IsWebsiteUp = False
         End If
    
         Set objHTTP = Nothing
     End Function

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts