Computing Staff
  • 0

MS-DOS Do While Loop

  • 0

here is a solution to produce a Do While Loop in DOS Batch:

@REM initialize test value to be “true”
@SET intCounter=1

 

:while

@REM test condition
@IF %intCounter% GTR 10 (GOTO wend)

@REM procedure where condition is “true”
@echo %intCounter%

@REM set new test value
@SET /a intCounter=intCounter+1

@REM loop
@GOTO while

:wend

@PAUSE

Share