Bill Farmer, Jr.
www.bill-farmer.com · my personal website

Bill Farmer, Jr.

Windows: Ping a range of IP Addresses

This is the best way without any third party programs, from the command prompt type….

for /L %z in (1,1,254) do @ping 10.0.0.%z -w 10 -n 1 | find “Reply”

Obviously change the ip address after the ping command to reflect your networks IP range.

The -w 10 makes it only wait 10 ms for a reply before moving on. If your network is slow you will have to up this value or take it out all together.

This will ping each IP in network 10.0.0.0/24, you have to adjust the command to accommodate different subnets.  For example to ping every host in 192.168.15.0/25, it would look like this:

for /L %z in (1,1,126) do @ping 192.168.15.%z -w 10 -n 1 | find “Reply”

Note, this will only return ‘live’ hosts that reply to the ping.  Be sure to adjust the -w statement when pinging across the internet to around 200 or so on a half-way decent connection.