How to? Using a custom ini file with TCC from Take Command

Aug 21, 2014
12
1
#1
I want to start my TCC instances in Take Command with a custom INI file. It seems like the INI file that I specified to Take Command (via the @ argument) is not automatically passed to TCC.

I tried setting my COMSPEC to "C:\Program Files\JPSoft\TCMD16x64\TCC.EXE" @C:\Path\MyCustom.ini and that works fine. However, when I close Take Command and restart it the "@" part is missing from the COMSPEC in the Options dialog. When I start a new tab, the INI file is not being passed in.

Looking at INI file, I see the line in the [TakeCommand] section:
COMSPEC="C:\Program Files\JPSoft\TCMD16x64\TCC.EXE" @C:\Path\MyCustom.ini

Hence, it seems like it is being truncated during load.

Is there any way of making this work?
 
#2
Hell Dan,

I use the following for my comspec in the TCMD config:

c:\tcmd\tcc.exe @d:\users\michael\ConfigFiles\tcc\tcc.ini //tcstartpath=d:\users\michael\ConfigFiles\tcc

This uses by customer tcc.ini file and also finds the aliases and functions files that I keep in the config directory. I've never had an issue with it being truncated.

My tcmd.ini file contains the following which mirrors the dialogbox identically.

COMSPEC=c:\tcmd\tcc.exe @d:\users\michael\ConfigFiles\tcc\tcc.ini //tcstartpath=d:\users\michael\ConfigFiles\tcc

Sorry I can't solve your problem, but thought maybe another example might help.

Michael
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,659
46
Albuquerque, NM
prospero.unm.edu
#3
I think that field is just intended to hold a filename, so it's truncating it at the first space after the closing quote. If your system has short filenames enabled, you might be able to hack around it using the SFN (without quotes).

What is the object of the game? If you want all instances of TCC to use these .INI settings, put them in the default .INI file. If you only want one or two instances using these settings, use the "Tab 1", "Tab 2", etc. interface at the bottom; the Command field should handle both filename and arguments.
 
#4
I have always used (at least) "/Q" in TCMD's COMSPEC. I can reproduce DanS's problem. If the first token in COMSPEC (the file name) is quoted then the remainder of the COMSPEC specification is lost when TCMD is stopped/restarted. All's well if the file name isn't quoted (and doesn't need to be). My simple test used
Code:
"d:\tc16\tcc.exe" /q
After TCMD was stopped/restarted, the "/Q" was gone.
 
#5
While it seems to be a bug, it can apparently be worked around. If I use
Code:
"g:\tc16\tcc.exe" "/Q" //tcstartpath=g:\tc16
only what's after "/Q" is discarded. If I use
Code:
"g:\tc16\tcc.exe" "/Q" "//tcstartpath=g:\tc16"
nothing is discarded and it seems to work correctly. And as I said before,
Code:
g:\tc16\tcc.exe /Q //tcstartpath=g:\tc16
works fine (but probably wouldn't if the file name needed quoting).
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,659
46
Albuquerque, NM
prospero.unm.edu
#6
While it seems to be a bug, it can apparently be worked around. If I use
Code:
"g:\tc16\tcc.exe" "/Q" //tcstartpath=g:\tc16
only what's after "/Q" is discarded. If I use
Code:
"g:\tc16\tcc.exe" "/Q" "//tcstartpath=g:\tc16"
nothing is discarded and it seems to work correctly.
Clever! I'll bet
Code:
"g:\tc16\tcc.exe" "/Q //tcstartpath=g:\tc16"
would work as well. (One pair of quotes for all the args.)