Solved

ping a group of computers

Posted on 1998-10-03
9
299 Views
Last Modified: 2013-12-23
how i can ping a range of ip addresses ( for example between 150.66.87.10 and 150.66.87.200 )?
0
Comment
Question by:eyad
  • 4
  • 4
9 Comments
 

Accepted Solution

by:
twine earned 70 total points
ID: 1563320
You may try and play with the following batch files.  They work fine for me but you may have to play with them to make them work with anything less than 100.  

Name this pingall.bat replace with the first 3 octs of your domain. This also assumes that you will get "Reply" for a good reply

@echo off
:START
call add.bat
ping 127.0.0.%H%%T%%D% | find "Reply" > nul
if not errorlevel 1 echo %H%%T%%D% >> GoodPing.txt
if %H%%T%%D%==254 goto DONE
goto START
:DONE


Call this add.bat and put in the same directory.

:: ADD.BAT
:: Increments a three digit number
:: Works by comparing each digit
:: H=hundreds, T=tens, D=digits
@echo off
if [%H%]==[] set H=1
if [%T%]==[] set T=0
if [%D%]==[] set D=0
:DIGITS
if %D%==9 goto TENS
if %D%==8 set D=9
if %D%==7 set D=8
if %D%==6 set D=7
if %D%==5 set D=6
if %D%==4 set D=5
if %D%==3 set D=4
if %D%==2 set D=3
if %D%==1 set D=2
if %D%==0 set D=1
goto DONE
:TENS
set D=0
if %T%==9 goto HUNDREDS
if %T%==8 set T=9
if %T%==7 set T=8
if %T%==6 set T=7
if %T%==5 set T=6
if %T%==4 set T=5
if %T%==3 set T=4
if %T%==2 set T=3
if %T%==1 set T=2
if %T%==0 set T=1
goto DONE
:HUNDREDS
set T=0
if %H%==9 set H=0
if %H%==8 set H=9
if %H%==7 set H=8
if %H%==6 set H=7
if %H%==5 set H=6
if %H%==4 set H=5
if %H%==3 set H=4
if %H%==2 set H=3
if %H%==1 set H=2
if %H%==0 set H=1
goto DONE
:DONE
echo %H%%T%%D%


You may strip the HUNDREDS off for the first 89 and then use the full format for all over 100.  Play with it and see what you think.

0
 
LVL 37

Expert Comment

by:bbao
ID: 1563321
It looks the proposed answer cannot do ping from 150.66.87.10 to 150.66.87.200 as the asker mentioned.
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1563322
How about FOR /L %A IN (10,1,200) DO PING 150.66.87.%A

Do a HELP FOR in a command box to get the FOR syntax..
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 37

Expert Comment

by:bbao
ID: 1563323
BlackMan's comment should be the answer. Hmm, it looks such command only can be done on NT system.
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1563324
That's right, Extended For is only on NT, but then, this is NT Networking :-)
0
 
LVL 37

Expert Comment

by:bbao
ID: 1563325
BlackMan, do you notice that NT's help does not include any information on Extended For. Does original version of NT4 support it? Maybe only with SP3, I think.
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1563326
I've used it since the initial build of NT 4, even NT 3.51 has some of the functions..
0
 
LVL 37

Expert Comment

by:bbao
ID: 1563327
Ping all? :)))

for /l %i in (0,1,255) do for /l %j in (0,1,255) do for /l %k in (0,1,255) do for /l %l in (0,1,255) do ping %i.%j.%k.%l
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1563328
:-)
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question