Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1682

LEAVE in a DO /S fileset loop only leaves one subdirectory

$
0
0
According to the documentation, "LEAVE exits from the current DO loop and continues with the command following its ENDDO." However, these commands:
Code:
  do file in /d"d:\" /a:-d /s "*"
    echo file is %_cwd\%file
    leave
    echo after the leave
  enddo
show that that is not true when processing subdirectories. In that case, processing of the loop is performed once (for the first file!) in each subdirectory. In each case, the LEAVE is executed, but sends control back to...

Read more

Viewing all articles
Browse latest Browse all 1682

Trending Articles