MasterRacker
New member
I whipped up a quick and dirty script to ping a device once a minute for two hours and log the results. The core is below. It works fine for my current purposes, however one thing that surprised me was the command prompt comes back right away. I was kind of thinking I would be able to CTRL+C to break out of it. If I need to kill it, I can use taskmgr, but I was wondering if there is a better way to handle this sort of thing.
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
Code:
for cnt = 0 to 120
pingResultMsg = Date & "," & Time & "," & ipAddr & "," & PingStatus(ipAddr)
set outFile = FSO.OpenTextFile (outFQN, ForAppending, true)
outFile.WriteLine (pingResultMsg)
outFile.Close
wscript.sleep(60 * 1000) ' pause 60 seconds
next
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]