how to save ping results in notepad with time and date?

windows inbuilt Powershell Ping feature to capture the ping response with timestamp

ping.exe -t google.com | ForEach {“{0} – {1}” -f (Get-Date),$_} | Tee C:\mysystemtogoogle.txt

ping.exe -t 192.168.2.250 | ForEach {“{0} – {1}” -f (Get-Date),$_} | Tee C:\mysystemtoserverip.txt

ping.exe -t 192.168.2.1 | ForEach {“{0} – {1}” -f (Get-Date),$_} | Tee C:\mysystemtogatewayip.txt

ping.exe -t erp.manaprojects.com | ForEach {“{0} – {1}” -f (Get-Date),$_} | Tee C:\mysystemtoerpdomain.txt

ping.exe -t 49.206.244.187 | ForEach {“{0} – {1}” -f (Get-Date),$_} | Tee C:\mysystemtoerpexternalip.txt

Windows inbuilt Ping feature accessible from comand prompt

Parameters used in the Ping feature

%date:~7,2% –days
%date:~4,2% — month
%date:~10,4% –years

%time:~1,1% — hours
%time:~3,2% –minutes
%time:~6,2% –seconds
%time:~9,2% –milliseconds

ping 192.168.2.1 -t >ping_%date:~7,2%%date:~4,2%%date:~10,4%_%time:~1,1%%time:~3,2%%time:~6,2%%time:~9,2%.log

reference site – 7 Ways to Timestamp Ping Results • Raymond.CC

QR code to access this page – how to save ping results in notepad with time and date?

Leave a Comment

Your email address will not be published. Required fields are marked *