Skip to content
Website under migration: We are moving to a new design. Some pages may look different or load slowly for a few days. Thank you for your patience.
SwitchFirewall
IPv4 Detecting…
IPv6 Detecting…

Continuous Ping with Date and Time Stamps (Save to File)

Last updated:

Introduction

The ping command is one of the first tools every network administrator reaches for when checking connectivity. But the default output has two big limitations:

Many real-world network issues only appear after hours — random packet loss at 3 a.m., high latency during video calls, or brief outages every few hours. To prove these problems (to your ISP, manager, or ticketing system), you need a log file with timestamps.

This article focuses on one of the most popular and reliable one-line Windows commands that adds real system date and time to every ping line and saves everything automatically to a file.

Why You Need Timestamped Ping Logs

Common situations where this technique is extremely helpful:

A simple text file with time + ping result is easy to read, search, and attach to emails or support tickets.

The Most Popular One-Line Command

This command is widely shared in networking forums because it works reliably on almost every Windows version (Windows 7, 10, 11, Server editions).

ping -t 1.1.1.1 | cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 1.1.1.1>nul" >D:\1.1.1.1.txt
  
Cisco Console Access Diagram

What this command does step by step:

How to Use It Correctly

  1. Open Command Prompt (cmd.exe) — preferably as Administrator
  2. Decide where to save the file (example: D:\ or C:\PingLogs\)
  3. Modify the command:
    • Change 1.1.1.1 to your target (e.g. 8.8.8.8, your gateway IP, server name)
    • Change the filename and path (e.g. >"C:\Logs\ISP-ping-log.txt")
  4. Paste the full command and press Enter
  5. Let it run as long as needed (hours, days…)
  6. Stop it with Ctrl + C

If you want to save to Desktop or Documents, use a path like:

>"%USERPROFILE%\Desktop\ping-8.8.8.8.txt"

Example Variations

Ping your ISP gateway (example 192.168.1.1):

ping -t 192.168.1.1 | cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 192.168.1.1>nul" >"C:\Logs\Gateway-ping.txt"
  

Ping Google DNS with better folder structure:

ping -t 8.8.8.8 | cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 8.8.8.8>nul" >"D:\Network Monitoring\2025-Google-DNS-ping.txt"
  

Tips for Better Results

Very frequent pings (every second) might be blocked or rate-limited by some firewalls or ISPs — the default ping interval is usually safe.

Conclusion

Adding real date and time stamps to continuous ping output is one of the simplest yet most powerful troubleshooting tricks in networking. The one-line command shown above has been helping Windows admins for years because it is short, reliable, and requires no extra software.

Next time you suspect “the internet is unstable”, just start this ping logger and let it collect evidence for you — automatically and silently. When the problem happens, you’ll have clear timestamps showing exactly when replies were lost or delayed.

Keep this command in your notes or as a .bat file — you’ll be surprised how often you come back to it.