The Script Library
Menu
The Script Library
Browse
Search
Submit
Reference
About
Contact
Link to Us
Index

Display

Home > Batch > Scripting Techniques > Retrieving Input





Call a DOS command from a FOR DO Loop



 

Description
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

 

Author/Submitter
Marty Lindsay

 

Batch Code

FOR /L %X IN (1,1,254) DO ping -n 2 10.10.17.%X | find /i "reply"	






Search The Library


Search String

Script Language