Well, i need to ping -t (overnight) few nodes (30).
In the morning (or day after) i need to chk some nodes against others, so i need a timestamp for every Reply i did get, or time out.
for /f "tokens=*" %q in ('ping localhost) do (echo %time% %q) == would almost be nice, just to redirect it to a file, and rid off
the new lines .. maybe i can handle that, ill try.
I'm too lazy to work out the syntax of CMD's "FOR /F"; I use 4NT
instead. The following command
ping localhost | FOR %fu IN (
@Con) ECHO %_time "%fu"
produces this output:
11:44:27 ""
11:44:27 "Pinging 127.0.0.1 with 32 bytes of data:"
11:44:27 ""
11:44:27 "Reply from 127.0.0.1: bytes=32 time<10ms TTL=128"
11:44:28 "Reply from 127.0.0.1: bytes=32 time<10ms TTL=128"
11:44:29 "Reply from 127.0.0.1: bytes=32 time<10ms TTL=128"
11:44:30 "Reply from 127.0.0.1: bytes=32 time<10ms TTL=128"
11:44:30 ""
11:44:30 "Ping statistics for 127.0.0.1:"
11:44:30 " Packets: Sent = 4, Received = 4, Lost = 0 (0 loss),"
11:44:30 "Approximate round trip times in milli-seconds:"
11:44:30 " Minimum = 0ms, Maximum = 0ms, Average = 0ms"
The quotes are necessary to prevent the redirection symbol which happens
to occur in the output ("time<10ms") being seen by the parser.
Obviously, this output can be redirected to a file. In addition, 4NT's
LOG command will produce a log file where each command is time-stamped.
These two can be combined by redirecting the command output to the LOG
file as well.
Like most professional tools, 4NT is not free. 4NT's FOR command is
documented at <
http://jpsoft.com/help/for.htm>