Monthly Archives: November 2013

MS-DOS Counted Loops – ITERATION

Using the /L switch for the FOR command, it is possible to count through a loop in MS-DOS; just like any other scripting languages.

Consider this as a very simple sample. It counts from 0 to 99; including both 0 and 99; with a step size of 1 and executes the loop’s body for each iteration.

FOR /L %i IN (0,1,99) DO (
  echo Attempt# %i