We are using ping command to monitor the networks, sometimes we have to monitor multiple IP address with continuous ping in different windows. Normal command line is with a black colour background and white text. But it will be better to show a red window if the Request timed out. And the default success pings with a green background. Here is the script to do the ping with color output results.
Prompting an IP address and set to a variable named %IP%, and its pinging once with 32 bytes of data. If it is failed the background color will change to red. And display “Request timed out” then wait for some title . We used a self ping for sleep function. The code put it in loop so it will ping continuously.
:: color Ping
:: Code By Binbert.com
echo off & cls
set /p IP=Enter your IP Address :
:top
PING -n 1 %IP% | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: Color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
echo off & cls
:top
PING -n 1 www.google.com | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: Batch Script
:: Color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 53, 20
echo off & cls
:top
PING -n 1 www.google.com | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 54, 15
@echo off
cd \
ipconfig/flushdns
ipconfig/registerdns
echo off & cls
:top
PING -n 1 202.126.40.5 | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 54, 15
echo off & cls
cd \
ipconfig/flushdns
ipconfig/registerdns
:top
PING -n 1 202.126.40.5 | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: Batch Script
:: Color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 53, 20
echo off & cls
:top
PING -n 1 www.google.com | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 54, 15
@echo off
cd \
ipconfig/flushdns
ipconfig/registerdns
echo off & cls
:top
PING -n 1 202.126.40.5 | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
:: color Ping
:: Code By Binbert.com
:: Edited By FreeSoftAppZ.webs.com
mode 54, 15
echo off & cls
cd \
ipconfig/flushdns
ipconfig/registerdns
:top
PING -n 1 202.126.40.5 | FIND "TTL="
IF ERRORLEVEL 1 (SET OUT=4F & echo Request timed out.) ELSE (SET OUT=2F)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top










