Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to make a bat file to run on a win2k pro machine that will ping an ip range (ie 192.168.10.1 - 192.168.10.254 and pipe the info to a text file. I had one years ago adn lost it. I can do it in a unix environment but having problems in the windows environment.

Hi Oranda
i think this is what you are looking for!Instead of manually pinging all IP addresses on your LAN you can use this nice command:
Open Command Prompt and type:
FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">>c:\ipaddresses.txt
The "-n 1" is for only 1 ping packet to be sent to each computer.
Change 192.168.0 to match you own Network ID.
This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called IPADDRESSES.TXT in C:\, where it will list only the IP addresses that gave a reply.
You can also add a -a to the PING command to resolve all the responding IP addresses to HOST names, but doing so will cause the script to take a considerable time to finish:
FOR /L %i IN (1,1,254) DO ping -a -n 1 192.168.0.%i | FIND /i "Reply">>c:\ipaddresses.txt
don't forget to type the command in 1 line.
Saleh

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |