Software >> OS >> Windows >> Command Line >> For >> How to use FOR to loop thru a range of variables or list of numbers



eg.
 

## In batch file :

FOR /L %%a in (1,1,254) DO @tracert  172.31.5.%%a
 

## On a command line:

FOR /L %a in (1,1,254) DO @tracert  172.31.5.%a