Ping multipal IP with background Colour changes in windows

Hello Experts,
how does make a bat file for continuous Ping multipal IP with background Colour changes ?
for example:-
start ping -t 192.168.207.11 -l 0
start ping -t 192.168.207.12 -l 0
start ping -t 192.168.207.13 -l 0
start ping -t 192.168.207.14 -l 0
start ping -t 192.168.207.15 -l 0
LVL 1
Rajat SehgalFounder Enhance TechnologyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Unless this is purely an educational activity trying to learn more about DOS scripting, I would use one of the many freeware Windows ping utilities for this task.  Here are a couple that are worth a look and allow you to see status of a set of nodes.



»bp
1
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
Sir i need implement with DOS scripting only.
0
Bill PrewIT / Software Engineering ConsultantCommented:
See if this gets you started.  There is a driver bat file (pingstart.bat), and then a worker one (pingloop.bat).  Place a list of the IPs to be monitored into the "iplist.txt" file, and then run the "pingstart.bat" file to launch a worker window for each IP in the file.  Color will change depending on status from the PING command.

There is no easy way to see the full output of the PING command in the windows since we need to capture that internally in the BAT file and look at it to determine if the PING failed.  For successful PINGs we see one line from the PING command, for fails we see none.

You may want to add a delay in the PING loops and not monitor constantly, could slow down the system running all this.

***** PINGSTART.BAT *****
@echo off
setlocal

set "iplist=iplist.txt"

if not exist "%iplist%" (
    echo Missing IPLIST file "%iplist.txt"
    exit /b
)

for /f "usebackq tokens=*" %%i in ("%iplist%") do (
    start pingloop.bat %%~i
)

Open in new window

***** PINGLOOP.BAT *****
@echo off
setlocal

set colorUp=2F
set colorDown=4F

if "%~1" EQU "" (
    exit /b
)

title IP:%~1 - Status:

:Loop
    echo %DATE% %TIME%
    ping -n 1 -l 0 %~1 | find "TTL=" && (
        color %colorUp%
        title IP:%~1 - Status:UP
    ) || (
        color %colorDown%
        title IP:%~1 - Status:DOWN
    )
    goto :Loop

Open in new window

***** IPLIST.TXT *****
192.168.0.1
192.168.0.22
192.168.0.222

Open in new window


»bp
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
Thank You Sir.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.