Header Ads

Make Your CMD Pinger More Attractive!!! [PINGER FOR BUBU, HSS, EXPAT, & OTHER VPNs]

My CMD Pinger with reply background color indicator!

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.


Color Legend:
Green - with reply
Red - request timed out

What is happening in this Batch file?

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.
Original Batch Script

:: Batch Script
:: 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
My Modified Batch Script

:: Batch Script
:: 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

Additional command by sir edzrhomski07
siguro lagyan mo nito ts. para di masyado malaki.

:: 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
Adjust the size of its window from this line: mode 53, 20
where "53" is the width size, and "20" is the height size.

Recommended window size command is: mode 54, 15

with FLUSHDNS & REGISTERDNS:

:: Batch Script
:: 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
OR

:: Batch Script
:: 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
Additional command by sir edzrhomski07

siguro lagyan mo nito ts. para di masyado malaki.

:: 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
Adjust the size of its window from this line: mode 53, 20
where "53" is the width size, and "20" is the height size.

Recommended window size command is: mode 54, 15

with FLUSHDNS & REGISTERDNS:

:: Batch Script
:: 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
OR

:: Batch Script
:: 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


No comments

blogmytuts. Powered by Blogger.