How to? debug a nested batch file

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Sep 5, 2012
2
0
#1
I have a batch file, that calls another batch file, as follows:
...
set my_path=%~dp0%
cd /D %my_path%
call remove\remove.bat
...

I cannot step into(F11) the called batch.
If replace the string
call remove\remove.bat with
call c:\tt\tada\remove\remove.bat it works fine.
My batch file works fine executed in a cmd-shell but not in the Take debugger IDE.
I understand it has something to do with path settings, but what and how?
My demands is that it has to be a relative path because the top folder (containing several more batch files and other calls) can be put anywhere.
How do set up the tool to handle this path problem
 

rconn

Administrator
Staff member
May 14, 2008
10,100
85
#2
The batch debugger will start a new shell where it executes the batch files. If you want to set up specific paths, you'll need to put them in your TCSTART, which the IDE will execute when the IDE initializes (not when each batch file runs).

Depending on how you start it, the IDE will inherit either from the TCC environment (BDEBUGGER), or the Take Command environment (if started with the Edit/Debug button).
 
Sep 5, 2012
2
0
#3
The batch debugger will start a new shell where it executes the batch files. If you want to set up specific paths, you'll need to put them in your TCSTART, which the IDE will execute when the IDE initializes (not when each batch file runs).

Depending on how you start it, the IDE will inherit either from the TCC environment (BDEBUGGER), or the Take Command environment (if started with the Edit/Debug button).
Robert says:
I don't understand?
Do I have to do something, in Take, I don't have to do when executing in the windows cmd window?
The call to --call remove\remove.bat with is ok in cmd but not in the Take debugger (and yes I start with the Edit/Debug button).
In my original batch file the call to remove.bat is followed by 10 other calls to other batch files which in it's turn has calls to other batch files. All with relative paths and all in separate directories.

What do I do to make this work in the Take debugger??
Please give me an answer with an example.
We are testing different batch debuggers and the one that suits us we will buy. So far this tool is not working as we expect to.