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
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

The only modification required is to change the two ip ranges (192.168.1.) to the appropriate range you want to test, where ever the bat file is run from, it will create a text file for each ip address scanned and will indicate whether a response was returned with either -up or -down as the end part of the text files name

Share your views...

1 Respones to "Batch file to test ip address range."

Me said...

IF %t%==254 Exit

August 4, 2012 at 9:21 PM

Post a Comment



Our Partners

DISCLAIMER: This site does not store any files on its server. I only index and link to content provided by other sites. All the files are from internet. In case of any query/objection regarding copyright or privacy, please inform me at Contact me and leave your comment here. I will immediately respond to you.