Submitted By: Andrew Stepleton

Uses Ping.exe to verify network connectivity.

Visual Basic
Edit|Remove
WScript.Echo "IsAlive: " & IsAlive("LocalHost")

Function IsAlive(sIP)
   '* Command Window will flash if not executed from CScript host.
   Set oShell = CreateObject("WScript.Shell")
	intPings = 1  '* Number of pings to attempt
	intTO = 100   '* Timeout in Milliseconds
	Set objPingOut =oShell.Exec("%comspec% /c ping.exe -n " & intPings & " -w " & intTO & " " & sIP).StdOut
	If InStr(objPingOut.ReadAll,"TTL=") Then IsAlive = True Else: IsAlive = False
End Function