Command Prompt for Windows

Command WHILE


Conditionally perform a command zero or more times.


WHILE [NOT] condition DO command
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.
commandSpecifies the command to carry out if the condition is met. Parameter command can also be another WHILE command.
NOTCarry out the command only if the condition is false.


Examples on using WHILE.

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