Discussion forum for all Windows batch related topics.
- Posts: 35
- Joined: 02 May 2016 18:59
Hi, I recently got this message printed to me - is this documented anywhere? is this known?
This message I did not write:
Code: Select all
****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******
- Posts: 894
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
This happens when you've got setlocal in a loop somewehere. According to that error message, your script ran setlocal without endlocal 593 times.
- Posts: 907
- Joined: 30 Aug 2007 08:05
- Location: Germany, Bochum
the error is not related to setlocal, but to the call stack.
Probably you have a recursion in your code, like
- Posts: 3
- Joined: 25 Jun 2019 07:21
Batch recursion can be caused by various means, but essentially you ...
... well, have a batch recursion. Somewhere.
I occasionally hit that problem, and in my case it always is this:
I have a big collection of scripts, and a very limited set of them are scripts that called by others, but do not do many calls on themselves.
These are sort of small but essential basic scripts, that are often called in the start of a lot of other "normal" scripts.
If then I make a change in such a special script, calling another script, I end up calling a regular script, that starts with calling the script that was the caller in the first place.
And yes, if the call is unconditional ... that's how I create batch recursions.