Solved

ping a group of computers

Posted on 1998-10-03
9
298 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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