Without going through a lot of details that I believe are irrelevant, I have a batch file that goes through all of the directories in a directory tree doing things that must be done after every subdirectory of every given subdirectory has been visited, so as far as I know (I could certainly be wrong, I suppose!) the simple "For /R[ecursive" loop won't do the job. So I have a (sample!) batch file ("D:\RecurseDirectories.btm") that does nothing more than the directory recursion and it looks like this:
Well, when I run this sample batch file it executes for a second or two then the TCC session in which it is being run terminates without notice, and if I append ">>&D:\RecurseDirectories.txt" to the command the .txt file contains exactly what I would expect it to contain until the TCC session terminates, and the last line in the .txt file is the "Call" statement.
I would assume that I am exceeding some kind of "nesting" limit for TCC (although I don't know that for sure, of course). Is there any (easy!) way to avoid this limitation? Note that I want the "Cancels"'s to cancel the whole batch file recursion sequence.
- Dan
Code:
@Echo On
SetLocal
If "%1" == "D:\Top-Level Directory\2nd-Level Directory" Quit 0
On Break Goto Cancel
On ErrorMsg Goto Cancel
Set StartDir=%1
If "%StartDir" == "" Set StartDir="%_CWD"
For /D %D in ("%StartDir\*") Do (
Call D:\RecurseDirectories.btm "%D"
)
EndLocal
Quit 0
:Cancel
EndLocal
Cancel 4
I would assume that I am exceeding some kind of "nesting" limit for TCC (although I don't know that for sure, of course). Is there any (easy!) way to avoid this limitation? Note that I want the "Cancels"'s to cancel the whole batch file recursion sequence.
- Dan