I’m trying to make a batch script that does a ping sweep. It asks what subnet, where to start then where to end then it is supposed to start going. Unfortunately it keeps stopping at the actual ping command. Seems to be kicking at the For command.
@echo off
set /p a= What subnet are you looking to ping?
set /p b= Where would you like to start on the network?
set /p c= What IP Address would you like to stop on?
For /l %i in (%b%,1,%c%) do @ping %a%.%i -w 10 -n 1 -a | find "Reply"
pause
This is the command so far.
Bit of a Noob to all this honest.
I tried putting the variable into just the ping portion and it worked fine.
New contributor
Joey Remagen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5