find all active ip?s in a subnet

FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i "Reply">> c:\ipaddresses.txt
documents all active ips on a subnet and saves to txt file.
Sample Output
c:\ipadresses.txt:

Reply from 10.254.254.1: bytes=32 time<1ms TTL=255

Reply from 10.254.254.2: bytes=32 time<1ms TTL=255

Reply from 10.254.254.3: bytes=32 time=5ms TTL=255

Reply from 10.254.254.30: bytes=32 time<1ms TTL=128

Reply from 10.254.254.31: bytes=32 time<1ms TTL=128

Reply from 10.254.254.32: bytes=32 time<1ms TTL=128

Reply from 10.254.254.33: bytes=32 time<1ms TTL=128

Reply from 10.254.254.34: bytes=32 time<1ms TTL=128

Reply from 10.254.254.60: bytes=32 time<1ms TTL=64

Reply from 10.254.254.61: bytes=32 time=3ms TTL=60

Reply from 10.254.254.62: bytes=32 time<1ms TTL=64

Reply from 10.254.254.63: bytes=32 time=1ms TTL=64

Reply from 10.254.254.90: bytes=32 time<1ms TTL=128

Reply from 10.254.254.201: bytes=32 time<1ms TTL=128

Reply from 10.254.254.202: bytes=32 time<1ms TTL=128

Reply from 10.254.254.204: bytes=32 time<1ms TTL=128

Reply from 10.254.254.205: bytes=32 time<1ms TTL=128

Reply from 10.254.254.206: bytes=32 time<1ms TTL=128

Reply from 10.254.254.207: bytes=32 time<1ms TTL=128

Reply from 10.254.254.208: bytes=32 time<1ms TTL=128

Reply from 10.254.254.209: bytes=32 time<1ms TTL=128

Reply from 10.254.254.212: bytes=32 time<1ms TTL=128

Reply from 10.254.254.213: bytes=32 time<1ms TTL=128

Reply from 10.254.254.214: bytes=32 time<1ms TTL=128

Reply from 10.254.254.215: bytes=32 time<1ms TTL=128

Reply from 10.254.254.217: bytes=32 time<1ms TTL=64

Reply from 10.254.254.221: bytes=32 time<1ms TTL=128

-9
2010-06-29 21:02:21

2 Alternatives + Submit Alt


  • 13
    sudo arp-scan -I eth0 192.168.1.0/24
    sata · 2010-07-01 02:46:41 3
  • nmap for windows and other platforms is available on developer's site: http://nmap.org/download.html nmap is robust tool with many options and has various output modes - is the best (imho) tool out there.. from nmap 5.21 man page: -oN/-oX/-oS/-oG : Output scan in normal, XML, s| Show Sample Output


    6
    nmap -v -sP 192.168.0.0/16 10.0.0.0/8
    anapsix · 2010-07-14 19:53:02 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: