Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Command line DO in batch files

May
12,998
174
Some of the syntaxes work. This one screws up:

Code:
do i=1 to 5
    echo foo
    set /a due=%_datetime + 1
    do until datetime %due ( delay /m 1 )
    echo xxx
enddo
"xxx" is never seen. [Note, adding 1 to a datetime doesn't work when going around "minute corners" so don't try the test above just before a new minute.]

Oddly, you can fix it with

Code:
    do until datetime %due ( delay /m 1 )
    enddo
    echo xxx
 

Similar threads

Back
Top