Hi! I am a newbie with programming. I have two Windows 2003 servers. Both
servers have the same service that only one can run at one time. I would
like to create a script that would check the network status of Server A using
ping.exe. If the ping fail on Server A, Server B will start the service. I
figure out how to write teh ping but not sure how to incorporate the other
step.
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("ping 10.0.0.1 -t")
Set objStdOut = objWshScriptExec.StdOut
Do Until objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
If Len(strLine) > 2 Then
WScript.Echo Now & " -- " & strLine
Else
Wscript.Echo strLine
End If
Loop