I have a big batch file where Im using setlocal ENABLEDELAYEDEXPANSION several times. Im wondering if typing it once is enough or does it have to be typed every single time im setting some variables. Is this why Im also getting the “maximum setlocal recursion level reached” message?
Share
It depends on what you’re trying to do, but usually, you do not need to specify this instruction more than once. Parent variables values are always passed down to the child (called) script, but “setlocal” keeps them from being passed back up when the child script ends. This also applies to subroutines within a script. If you use a circular (self-invoking) call, and the call uses setlocal, you can easily exceed the stack limit and get this error.
message edited by nbrane