Save Ping + time Output in a text file

ping

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 8.8.8.8 > pingy_mac_pingersen.txt

Contents of pingy_mac_pingersen.txt;

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

Ping statistics for 8.8.8.8:
    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 8.8.8.8 > C:\pingy_mac_pingersen.txt

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

c:\ping.bat
Related Question