Save Ping + time Output in a text file


I want to made a bat file that made to me a report with ping every 1 second + the time and date.
I use Windows 7 .
I tried to read here but doesn't help to me.

Thanks !!

Best Answer

Same as Linux, output ping command to text,

ping > pingy_mac_pingersen.txt

Contents of pingy_mac_pingersen.txt;

Pinging with 32 bytes of data:
Reply from bytes=32 time=97ms TTL=52
Reply from bytes=32 time=231ms TTL=52
Reply from bytes=32 time=51ms TTL=52
Reply from bytes=32 time=77ms TTL=52

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 51ms, Maximum = 231ms, Average = 114ms

I'm not sure about the time function you mean but basically the *.bat would contain the commands the same way you would issue them in terminal so as an example-- ping.bat ;

@echo off
ping -t > C:\pingy_mac_pingersen.txt

run in terminal including location of *.bat file in command;