Batch file to test ip address range.
This is a cool batch script that I found to ping a range of IP addresses and report whether they respond to the ping.
Simply copy and paste this code into a notepad file and save with the bat extension (remember to enclose the save as file name in quotes so that it doesnt add a txt extension.
@echo off
SET t=0
:start
SET /a t=t+1
ping -n 1 -l 1 192.168.1.%t% > nul
if %errorlevel%==0 echo Host %t% is UP! >> 192.168.1.%t%-up.txt
if %errorlevel%==1 echo Host %t% is DOWN! >> 192.168.1.%t%-down.txt
IF %t%==999 Exit
Goto start
Tags: tips-tricks
Subscribe to:
Post Comments (Atom)
Share your views...
1 Respones to "Batch file to test ip address range."
IF %t%==254 Exit
August 4, 2012 at 9:21 PM
Post a Comment