Something like (pseudo-code)
ping a computer
if %ERRORLEVEL% neq "0" Then Echo Date time > Log.txt
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
Set tempfile = fso.GetFile(tempfile)
Set ts = tempfile.OpenAsTextStream(1)
strResponse = "Nid yw'ch cyfrifiadur yn gweld y gweinydd."
gweldgweinydd="false"
Do Until ts.AtEndOfStream = True
If InStr(ts.ReadLine, "Reply") > 0 Then
strResponse = Now()
pingcomplete="true"
Exit Do
End If
Loop
ts.Close
if pingcomplete="true" then
Set logtxt = fspenTextFile(logfile, ForAppending, True)
logtxt.WriteLine(strResponse)
logtxt.Close
end if
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.