According to the documentation, "LEAVE exits from the current DO loop and continues with the command following its ENDDO." However, these commands:
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
Code:
do file in /d"d:\" /a:-d /s "*"
echo file is %_cwd\%file
leave
echo after the leave
enddo
Read more