After going through this problem twice, I thought I would post it here to find out if anyone knew how to get around it.
I cannot break out of nested loops using goto , because it seems that when it exits the inner loop, the brackets then do not match, because it never reached the inner close.
I narrowed it down to a very simple example
for %%a in (1,2,3) do ( for %%b in (4,5,6) do ( echo Breaking goto :BREAK ) :BREAK )
This results in an error.
) was unexpected at this time.
I thought maybe adding extra brackets might solve the problem, but that will not help if I donβt know what I will break, if it is a conditional break, this is the same problem.
Is there any easy alternative to exiting the inner loop back to the outer, even if it's a conditional break using if and else 's?
batch-file
Bali c
source share