Env vars in tcmd.ini

ccb

Jul 13, 2009
47
0
I am trying to share tcmd.ini across two computers. There a few differences between the two that I thought I could account for with environment variables.
For example:
Code:
[Tab3]
Title=
Command="C:\Program Files\JPSoft\TCMD12x64\tcc.exe"
Directory=%Work%\branch\
RunAs=
Password=

However, that doesn't work. Is there some way to configure the starting tabs based on something like environment variables? Starting add'l tcc instances in tcstart (where tcstart can switch on computername)?
Thanks for any suggestions....
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
I am trying to share tcmd.ini across two computers. There a few differences between the two that I thought I could account for with environment variables.
For example:
Code:
[Tab3]
Title=
Command="C:\Program Files\JPSoft\TCMD12x64\tcc.exe"
Directory=%Work%\branch\
RunAs=
Password=

However, that doesn't work.

I just tried that, and it works fine for me. I don't even need the trailing percent sign, which suggests that you can probably use internal variables and even functions in there....

Are you aware that TCC inherits its environment from Take Command, which inherits it from Explorer? You need to set your environment variable before Take Command starts, e.g. through System Properties. And changing system environment variables won't automatically update Take Command's copy of the environment block, unless you have SettingChange=Yes in the [TakeCommand] section of your .INI file. Otherwise, you'll have to restart Take Command to get the changed environment.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
However, that doesn't work. Is there some way to configure the starting tabs based on something like environment variables? Starting add'l tcc instances in tcstart (where tcstart can switch on computername)?
Thanks for any suggestions....

You don't say what version you're using. Environment variable support for TCMD.INI was added in v12, so if you're using that it should work. If you're running v11 or earlier, you cannot do it.
 

ccb

Jul 13, 2009
47
0
You don't say what version you're using. Environment variable support for TCMD.INI was added in v12, so if you're using that it should work. If you're running v11 or earlier, you cannot do it.

[C:\Program Files\JPSoft\TCMD12x64]
>ver
TCC 12.10.65 x64 Windows 7 [Version 6.1.7601]

When TakeCommand starts, I get the message:
The directory name is invalid. "%Work\"

I have tried %Work, %Work%, and %%Work%%. The env var is set, and is listed when I use 'set' at the command prompt.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
---- Original Message ----
From: ccb
...
| TCC 12.10.65 x64 Windows 7 [Version 6.1.7601]
...
|
| When TakeCommand starts, I get the message:
|
| Quote:
| The directory name is invalid. "%Work\"
|
| I have tried %Work, %Work%, and %%Work%%. The env var is set, and is
| listed when I use 'set' at the command prompt.

Is the environment variable WORK defined in the registry? You can verify that it is in a stand-alone instance of CMD.EXE (i.e., not in a TCMD tab). Alternately, in TCC you can check that it is in the Windows-provided environment by using the /D, /S, /U and /V options of the SET command - at least one of them will show it.
--
Steve
 

ccb

Jul 13, 2009
47
0
Is the environment variable WORK defined in the registry? You can verify that it is in a stand-alone instance of CMD.EXE (i.e., not in a TCMD tab). Alternately, in TCC you can check that it is in the Windows-provided environment by using the /D, /S, /U and /V options of the SET command - at least one of them will show it.
Thanks for the reply. The env var 'Work' appears in the list from the 'set ' command in cmd.exe, as well as in the list from "set /U" in tcc.exe.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
> Thanks for the reply. The env var 'Work' appears in the list from
> the 'set ' command in cmd.exe, as well as in the list from "set /U"
> in tcc.exe.

The variable *must* be in the TCC environment for it to be expanded in the
TCMD.INI. Yours is apparently not, if it's only visable with SET /U.
(Which displays the registry variables, not the actual environment content.)
 

ccb

Jul 13, 2009
47
0
I guess I don't understand what this means:
The variable *must* be in the TCC environment for it to be expanded in the TCMD.INI.

[C:\temp]
>set /s >! env.txt & find "work" env.txt
---------- ENV.TXT
Work=c:\work
[C:\temp]
>set /E >! env.txt & find "work" env.txt
---------- ENV.TXT
CMDLINE=find "work" env.txt
Work=c:\work

Maybe the problem is here, in tmcd.ini:
[Tab1]
Title=
Command="C:\Program Files\JPSoft\TCMD12x64\tcc.exe"
Directory=%Work
RunAs=
Password=

I have tried putting quotes around %Work, as well.

Thanks for the reply...
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Sat, 14 May 2011 11:45:02 -0400, ccb <> wrote:

|I guess I don't understand what this means:

Start TCC and do "SET" (no options). Do you see the variable "Work"?
 

ccb

Jul 13, 2009
47
0
Start TCC and do "SET" (no options). Do you see the variable "Work"?

[C:\Users\Charles\AppData\Local\Temp]
>ver
TCC 12.10.65 x64 Windows 7 [Version 6.1.7601]
[C:\Users\Charles\AppData\Local\Temp]
>set >! env.txt & find "work" env.txt
---------- ENV.TXT
Work=c:\work
 
May 20, 2008
11,400
99
Syracuse, NY, USA
I guess I can reproduce this. The variable SHRALIAS_SAVE_PATH has been in my system environment for years; I'm confident all apps get it. SET shows it in TCC. When TCC is running in TCMD, it is set in TCC's parent:

v:\> pset %_PPID SHRALIAS_SAVE_PATH
e:\ShrDump\

Using the dialog, I created:
[Tab2]
Title=
Command=d:\tc12\tcc.exe
Directory=%SHRALIAS_SAVE_PATH
RunAs=
Password=

And when I start TCMD I get:

---------------------------
Take Command
---------------------------
The directory name is invalid.
"%SHRALIAS_SAVE_PATH"
---------------------------
OK
---------------------------
 
May 20, 2008
11,400
99
Syracuse, NY, USA
This (The directory name is invalid) also happens in the Tabs\Run dialog if you enter, for example, "%windir\notepad.exe". Are environment variables expected to work there?
 

ccb

Jul 13, 2009
47
0
This appears to work as expected in latest update:
[Tab1]
Title=
Command="C:\Program Files\JPSoft\TCMD12x64\tcc.exe"
Directory=%Work%
RunAs=
Password=

[C:\Program Files\JPSoft\TCMD12x64]
>ver

TCC 12.10.66 x64 Windows 7 [Version 6.1.7601]
 
Similar threads
Thread starter Title Forum Replies Date
L WAD ECHO. expansion of non-existent env-vars differs from CMD.exe Support 6
M How to make Lua modify env-vars Support 18
MickeyF how to work with env var with special characters in the name Support 5
noahcoad How to? Create shortcut with env var in path Support 4
D Redirection to clip - env dependency? Support 3
N Can't set an env variable via pipe Support 8
x13 Q: Unquoting vars and arrays Support 35
R ffind not setting %_ffind_ vars if /f is used Support 7
CWBillow Setting and changing Vars in batch files Support 26
M How to? Determine a whether vars beginning with certain characters exist... Support 5
D Bug TCMD /X option Support 6
vefatica TCMD hides itself! Support 3
vefatica Tray min'd TCMD and ACTIVATE Support 6
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
kb6ojs How to? "Specified Account Already Exists" error installing TCMD v27 Support 12
CWBillow TCMD Colors Support 8
Jay Sage Issues With TCMD File Explorer Support 0
C Last TCMD that supports win 7? Support 5
gentzel TCMD background color confusion Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Alpengreis Remaining TCMD background process (v26) ... Support 19
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
G TCMD crash when copy Support 3
Joe Caverly DrawVLine results different in TCMD tab and detached TCC Support 11
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
nikbackm TCMD 25 - Unregister older TCMD version Support 2
G Documentation on TCMD.INI Support 9
R New Clear Buffer in TCMD Home Menu Support 2
CWBillow Back up TCMD tabs Support 2
CWBillow Upgrade Windows 10's effect on TCMD and TCC Support 3
DrusTheAxe TCMD 24.02.49 x64 crashed due to DivideByZero :-( Support 4
A After update to 24.02.49, helpfile tcmd.chm hangs when opened Support 0
David McClelland TCMD 24 & Perl - perl thinks it's own executable is ...\TCMD24\TCC.EXE??? Support 3
dcantor How to? Can 32-bit TCC be run on a system with 64-bit TCMD and TCC installed? Support 6
W pdir returns diff results between tcc and tcmd - one is an error msg Support 5
vefatica What's TCMD's problem with ^e[0m? Support 13
CWBillow TCMD PowerShell Tab elevated Support 6
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
vefatica TCMD output invisible on Win10 Support 22
J Moving from TCC v22 to TCMD v24 issues Support 3
RChrismon How to? Copy TCMD.INI to New Version Support 7
rps TCMD OPTIONS dialog Support 2
rps TCMD Tabs priority option setting Support 0
D Can we fix the scaling for TCmd? Support 14
CWBillow TCMD Tab Defs Support 4
A How to? TCMD Configuration Dialog: 'Smooth Scrolling' Option missing? Support 1
A Fixed [23.0.22]: TCMD crashes shortly after start, TCC keeps running in background Support 6

Similar threads