Documentation Locating the TCMD.INI File

Dec 2, 2008
212
2
Canada
#1
The documentation says:

Locating the TCMD.INI File

When starting Take Command or a Take Command Console (TCC) shell:


  • If there is an @d:\path\inifile option on the startup command line, Take Command will use the path and file name specified there.
  • Otherwise, the default TCMD.INI file name is used, and the search starts in the directory where the Take Command program file is stored. If the .INI file is not found, Take Command will look in the "%PROGRAMDATA%\JP Software\Take Command x64 18.0" directory, and finally in the %LOCALAPPDATA% directory.

If no .INI file is found, all options are set to their default values. A new .INI file will be created, using the default location and name, as explained above.

----------------

Take Command is loaded at, "C:\Program Files\JPSoft\TCMD19_x64"

%PROGRAMDATA%\JP Software\Take Command x64 19.0" is “C:\ProgramData\JP Software\Take Command x64 19.0

%LOCALAPPDATA% is empty

But TCMD.ini is in "C:\Users\cgunhouse\AppData\Local\JPSoft" and nowhere else. No environment variables (i.e. Path) contain this path to the TCMD.INI, butTCMD does find the TCMD.ini file. Is there something missing in the documentation? There is nothing in the documentation that would point me to this directory. Is there something related to profiles?
 

rconn

Administrator
Staff member
May 14, 2008
10,749
97
#2
You had an old TCMD.INI. The former location was \<username>\appdata\local\jpsoft ; that was replaced recently (because of changes in Windows & Microsoft recommendations) to \programdata\jp software. However, to avoid breaking existing installations, TCMD will still also look in the old location for an existing TCMD.INI. New ones will not be created there (unless you specifically force it using @d:\path\inifile).
 
May 30, 2008
214
1
#3
You had an old TCMD.INI. The former location was \<username>\appdata\local\jpsoft ; that was replaced recently (because of changes in Windows & Microsoft recommendations) to \programdata\jp software. However, to avoid breaking existing installations, TCMD will still also look in the old location for an existing TCMD.INI. New ones will not be created there (unless you specifically force it using @d:\path\inifile).
What changes where those?

Seems that having the TCMD.INI in programdata by default would mean that all user accounts on a single computer would now use the same file by default. Which might be bad or good depending on what you want.
 
Dec 2, 2008
212
2
Canada
#4
With my tinkering with TCMD.INI files I have come across something that I thought would function differently.



I have two directories “c:\jpsoft\startup” and “c:\jpsoft\startup\TCStart” and each has a TCStart.btm file and “c:\jpsoft\startup\TCStart” has a TCMD.INI file in it as well.

The files TCMD.INI file in “c:\jpsoft\startup\TCStart” has the directives:

[4NT]

TCStartPath=C:\JPSoft\StartUp\TCStart

4StartPath=C:\JPSoft\StartUp\TCStart

[TakeCommand]

StartDirectory=C:\JPSoft\StartUp\TCStart

And the TCStart.btm file in “c:\jpsoft\startup\TCStart” has:

echo %_CWDS

SET FastTrack=1

CALL ..\TCStart.btm

The default TCMD.INI in “C:\ProgramData\JP Software\Take Command x64 19.0” has the following:

[4NT]

TCStartPath=C:\JPSoft\StartUp

4StartPath=C:\JPSoft\StartUp

[TakeCommand]

StartDirectory=C:\JPSoft\StartUp

And the TCStart.btm in “C:\JPSoft\StartUp” has:

@IF DEFINED FastTrack GOTO FastTrack

echo _ininame %_ininame

:

:FastTrack

:

So if I was to run the following:

tcmd.exe /@C:\JPSoft\StartUp\TCStart\TCMD.INI

(tried this without the “/” before the “@” too)​

I would expect “C:\JPSoft\StartUp\TCStart\TCStart.btm” to run and the log to look like this:

[ 1/21/16 8:41:58][11116] echo C:\JPSoft\StartUp\TCStart\

[ 1/21/16 8:41:58][11116] SET FastTrack=1

[ 1/21/16 8:41:58][11116] CALL ..\TCStart.btm

[ 1/21/16 8:41:58][11116] ..\TCStart.btm

[ 1/21/16 8:41:58][11116] IF NOT DEFINED Curr_Echo SET Curr_Echo=%_echo

[ 1/21/16 8:41:58][11116] IF DEFINED FastTrack GOTO FastTrack

[ 1/21/16 8:41:58][11116] GOTO FastTrack​

But instead, the TCStartPath, 4StartPath, and StartDirectory directives, which point to “C:\JPSoft\StartUp\TCStart” in "C:\JPSoft\StartUp\TCStart\TCMD.INI" are ignored and the defaults for these directives from the TCMD.INI in “C:\ProgramData\JP Software\Take Command x64 19.0” are used to find the TCStart.btm file and I get:

[ 1/21/16 8:51:56][10504] IF NOT DEFINED Curr_Echo SET Curr_Echo=%_echo

[ 1/21/16 8:51:56][10504] IF DEFINED FastTrack GOTO FastTrack

[ 1/21/16 8:51:56][10504] echo _ininame C:\ProgramData\JP Software\Take Command x64 19.0\TCMD.INI​

After this copy of TCMD.EXE is started, if you go to the Options and look up the “TCSTART/TCEXIT Path” it has been changed to “C:\JPSoft\StartUp\TCStart”. If you open a new Tab from this TCMD, it still ignores this directive and still uses the “TCSTART/TCEXIT Path” directive from the TCMD.INI in “C:\ProgramData\JP Software\Take Command x64 19.0”.
 
Last edited:
#5
TCMD knows nothing about TCSTART. The INI file used to start TCMD is not necessarily the one used by TCC (and TCSTART). What TCMD runs when it starts, and exactly how it runs it, is typically determined in Options\Tabs\COMSPEC. I don't think there is a way to start TCMD with a specified INI file and have TCC (in a tab) automatically use the same INI file.
 
Dec 2, 2008
212
2
Canada
#6
In the TCMD.INI in “C:\JPSoft\StartUp\TCStart”, I tried both:

COMSPEC=C:\JPSoftExe\tcc.exe //TCStartPath=C:\JPSoft\StartUp\TCStart

seems to work but it seems to ignore the "StartDirectory=C:\JPSoft\StartUp\TCStart" in the TCMD.INI and if I put

COMSPEC=C:\JPSoftExe\tcc.exe //TCStartPath=C:\JPSoft\StartUp\TCStart //StartDirectory=C:\JPSoft\StartUp\TCStart
I get the following error:

TCC: Error in command-line directive "StartDirectory=C:\JPSoft\StartUp\TCStart"

Is this an indication that there maybe an issue with the StartDirectory directive?
 
#7
StartDirectory is a TCMD option. To specify where a tabbed TCC will start, you might be able to put it in COMSPEC (not sure).

Code:
COMSPEC=C:\JPSoftExe\tcc.exe CDD ...
 
Last edited:
#8
I think you'll get the greatest independence between TCMD and its tabbed TCCs with a COMSPEC that specifies both the INI file for TCC and a CDD to the directory where you want it to start. For example,
Code:
g:\tc19\tcc.exe @g:\tcc19\special\tcmd.ini cdd c:\users\vefatica
 

rconn

Administrator
Staff member
May 14, 2008
10,749
97
#9
In the TCMD.INI in “C:\JPSoft\StartUp\TCStart”, I tried both:

COMSPEC=C:\JPSoftExe\tcc.exe //TCStartPath=C:\JPSoft\StartUp\TCStart

seems to work but it seems to ignore the "StartDirectory=C:\JPSoft\StartUp\TCStart" in the TCMD.INI and if I put

COMSPEC=C:\JPSoftExe\tcc.exe //TCStartPath=C:\JPSoft\StartUp\TCStart //StartDirectory=C:\JPSoft\StartUp\TCStart
I get the following error:

TCC: Error in command-line directive "StartDirectory=C:\JPSoft\StartUp\TCStart"

Is this an indication that there maybe an issue with the StartDirectory directive?
No. StartDirectory determines the startup directory for the File Explorer window in Take Command. It has nothing to do with TCC.
 
#10
There is a minor drawback with the new location of the TCMD.INI file:
- when I install v19 to a new computer (there is no TCMD.INI file in %LOCALAPPDATA%),
- the installation runs from an administrator account different from the normal user account.
It seems TCC (shortly) runs at completion of the installation and creates an empty TCMD.INI file. The file is then owned by the administrator and cannot be modified from the normal user account. I have to delete the file from the administrator account before I can get TCMD/TCC to store options from the normal user account.