Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Script to check URL and TELNET connection

666 views
Skip to first unread message

Martin Honnen

unread,
Nov 7, 2005, 12:50:40 PM11/7/05
to

Hardmandez wrote:


> I am happy enough with basic scripting but don't know where to start with
> the checking of the URL or TELNET session.

You can check a HTTP URL with MSXML e.g. VBScript
Set HttpRequest = CreateObject("Msxml2.XMLHTTP")
HttpRequest.open "HEAD", "http://example.com/", False
On Error Resume Next
HttpRequest.send
If Err.Number <> 0 Then
WScript.Echo "Error : " & Err.Number & ": " & Err.Description
Else
WScript.Echo "HTTP status: " & HttpRequest.status & " " _
& HttpRequest.statusText
End If
That will give you the HTTP status response code and text the server gives.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

0 new messages