Monday, March 14, 2011

Ping List of IPs

It's pretty easy to ping a single IP with help of standard 'ping' command. But sometimes it's necessary to ping several addresses at once. Unfortunately, ping's syntax doesn't allow you passing the prepared text file as an input parameter to check all IPs listed in it. What to do? Just download Dr.Batcher and start writing really useful script in it.
The script is quite simple. If looks like this:
@echo off
for /f %%i in (test.txt) do ping -n 1 %%i
You can easily enhance it with writing the results of pinging to the text file (log). Input TXT file (test.txt here) should just contain the list of addresses to be pinged, one per line.

No comments:

Post a Comment

Translate