Call a DOS command from a FOR DO Loop
If you need to repeat a DOS command multiple times then this FOR DO loop syntax will help. This example will do a ping command starting at 10.10.17.1, incrementing the counter by 1 each time, until it reaches .254
FOR /L %X IN (1,1,254) DO ping -n 2 10.10.17.%X | find /i "reply"
Search The Library