Close
Social profiles
batch file

A Batch file is a kind of script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter

This is how we can write a Batch file to test IP Address range.

 Code:

@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

The Only change you need to do is, change the IP ranges to yours

IF you need to check more articles about Networking go to the Networking category. Check more resources from Microsoft resource center.

Leave a Reply

Your email address will not be published. Required fields are marked *

Close