How to set working directory

Jul 29, 2011
20
0
#1
I purchased Take Command last week. I have a number of CMD files to create and maintain in a number of different directories. Each has references to other files, mostly SQL scripts, and uses relative paths from the current (location of the CMD file) directory. When I load the CMD file in the debugger, none of the file references work correctly. I have been searching this website for a way to set the working directory during a debugging session and have not been able to find help. A search of your documentation also revealed nothing.

Can you please tell me how to get the current directory set to the location of the CMD file during a debugging session?

Thanks,

Jim Brandley
 
Last edited:

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,725
47
Albuquerque, NM
prospero.unm.edu
#2
The batch debugger inherits its working directory from the instance of TCC which starts it, so just CD-ing to the batch file's location should do it.

If the BDEBUGGER's current location is not the same as the location you started it from, then chances are you're changing directories in your TCSTART file.
 
#5
In the PDF, it looks like the debugger was already running when you CD'd. That needs to be done before starting the debugger. The debugger inherits TCC's directory when it (the debugger) is started, and only if it's started by TCC. If you're using TC (TakeCommand) to start the debugger, it will get TC's current directory (which is quite likely to be different from TCC's).
 
Jul 29, 2011
20
0
#8
I did this:
1. Launch Take Command from the shortcut on the desktop.
2. CD C:\Projects\depot\tps\task\eagan3\src\sql\sqlserver
3.From main menu, select Tools/Edit/Debug
4. From the pop-up window, select File/Open and select the CMD file I am testing.
5. Click the start button.
6. Click the Run to breakpoint or end button.

Jim
 
Jul 29, 2011
20
0
#9
vefatica - Substituting BDEBUGGER for step 3 above fixed the problem! It appears that the debugger launch from the menu and command line behave differently.

Thanks for your help.

Jim
 
Last edited:
#11
Rather than changing TCMD's CWD, you can
- reference a fixed directory (e-g D:\MyHome\MyJunct),
- have this directory be a soft link (MKLNK thedirIwant D:\MyHome\MyJunct),
- have the button call a script (e-g D:\MyHome\BDebuggerInMyJunct.btm) that CDs to the soft link (cd %@truename[\MyHome\MyJunct] && BDEBUGGER …).