Purpose:Create loops in batch files.
Format:DO [n | FOREVER]
or
DO varname = start TO end [BY n ]
or
DO [WHILE | UNTIL] condition
DO varname IN [@]set
commands
[ITERATE]
[LEAVE]
commands
ENDDO
varname : The environment variable that will hold the loop counter, filename, or line from a file.
n, start, end : Integers between 0 and 2,147,483,647 inclusive, or an internal variables or variable functions that evaluate to such a value.
condition : A test to determine if the loop should be executed.
set : A set of values for the variable.
commands : One or more commands to execute each time through the loop. If you use multiple commands, they must be separated by command separators or be placed on separate lines.
File Selection
Supports extended wildcards, ranges, and include lists for the set.
Usage
DO can only be used in batch files. It cannot be used in aliases.
DO can be used to create 4 different kinds of loops. The first, introduced by DO n, is a counted loop. The batch file lines between DO and ENDDO are repeated n times. For example:
do 5
beep
enddo
I thought this is standard even for cmd batch processing but seems to be a 4os2 extension.
Anyway even if you don't mind about 4os2 scripts/users it's just irritating for every programmer as probably every scripting or programming language does have a command named do.