strTextFile = "url.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
arrLines = Split(strData,vbCrLf)
For Each strLine in arrLines
strwebsite= strLine
If PingSite( strWebsite ) Then
WScript.Echo strWebsite & " is Running!"
Else
WScript.Echo strWebsite & " is down!"
End If
Next
Set objFSO = Nothing
Function PingSite( myWebsite )
Dim intStatus, objHTTP
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
objHTTP.Open "GET", "https://" & myWebsite & "/", False
objHTTP.SetRequestHeader "User-Agent", "internetexplorer (compatible; MyApp 1.0; Windows NT 5.1)"
On Error Resume Next
objHTTP.Send
intStatus = objHTTP.Status
On Error Goto 0
If intStatus = 200 Then
PingSite = True
Else
PingSite = False
End If
Set objHTTP = Nothing
End Function