Command Prompt for Windows

Command DO


Conditionally perform a command one or more times.


DO { command(s) } WHILE | UNITL [NOT] condition
DO ( command(s) ) WHILE | UNITL [NOT] condition
commandSpecifies the command to carry out. Parameter command can also be another WHILE or UNITL command.
WHILE | UNITLSpecifies either the WHILE keyword or the UNTIL keyword.
NOTCarry out the command only if the condition is false.
conditionIs the following :-
( expr )Evaluate the parameter expr. A zero result is false, otherwise the condition is true. Parameter expr follows the same rules as parameter expr for command CALC. The brackets around parameter expr are mandatory and must be specified.


Command DO is used to implement both a DO..WHILE loop and a DO..UNTIL loop.

Examples on using DO.

Also see command CALC, WHILE, UNTIL, FOR, Command Grouping and Batch Files.