I Like it too, nice idea
if you Add a Time and date stamp to the Log file like Foxidrive did, and it will be perfect
I changed the code a littlebit and add what i said above
You can choose to log the Reply by setting the variable "LoggingMode" to yes or set it to any thing else (no) to not log any thing.
Also added the time and date foxidrive used when logging the reply.
And it display the latency time instead of the bar in the title barBased on Aacini code
set "IP=www.google.com" // IP or Address
set "LOG=%IP%.log" // Log File name and Location, name equal %IP%.log
set "LTime=200" // If OutResult Exceeds this time in ms it will turn the screen RED
set "LoggingMode=no" // if yes it will log the events, any thing else will not log
for /L %%i in (1,1,66) do set bar=!bar!@
mode con: lines=3
rem Ping the IP, get the time
for /F "delims=" %%a in ('ping "%IP%" -n 1 ^| findstr /C:"Reply from"') do (
for /F "tokens=7 delims== " %%b in ("%%a") do set LatencyTime=%%b
rem If the time changed: update log and screen
if %LatencyTime% neq %lastTime% (
if /i "%LoggingMode%" == "yes" echo %date% %time% - %line%>> "%LOG%"
set /A barLen=%LatencyTime:~0,-2% * 66 / LTime
if !barLen! lss 66 (
) else (
for %%l in (!barLen!) do set newBar=!bar:~0,%%l!
title Ping latency: !newBar!
echo Time: %LatencyTime% !newBar!
if !color! neq %lastColor% (
Added variable in line 8
Changed the name of the variable "time" to "LatencyTime" to avoid conflict with the %time% variable in line 26
Changed "!newbar!" in line 35 to "!LatencyTime!" to show the numbers instead of the bar as it doesn't display all of it
Modified line 26 to check logging Mode variable to log or not
I'm gonna use it instead of my old script, and might add few things too