0

I am not very good at programming but searching and modifying I am not trying to find a way to make a Batch Script in CMD to execute an infinite Ping that gives as a result in 3 colors according to a High, medium or low ping.

.- For a High Ping more than 200ms Red Color.

.- For a Medium Ping between 130ms to 199 Color Yellow.

.- For a Low Ping between 0ms and 129ms Color Green.

.- For a disconnection from the NETWORK the CMD background flashes Red and returns to its original background.

.- For a Timeout for this request the CMD background flashes Red and returns to its original background.

PS: This should be the result by color.

Example

At the moment I have only managed to change a few things:

@echo off
title Ping Checker
echo Ctrl+c To Stop Execution...
:top
PING google.com -n 1 %1 | FIND "TTL="
IF ERRORLEVEL 1 (
    SET in=0b
    color 04 
    echo Connection Interrupted...
    GOTO top
) else (
GOTO color
)
GoTo top
:color
color 02
ping google.com -n 2 > nul
GoTo top

0 Answers0