can we use environment variables in user command dialog?
Moderators: Hacker, petermad, Stefan2, white
can we use environment variables in user command dialog?
As TC usually allows me to use envvars everywhere, I am not sure if this is intended or not.
I am trying to create a user command, its parameter is a file. In the Parameters field, I select a file, with its absolute path, the command works fine.
If I change the path so that it contains an environment variable, the command does not work anymore (does nothing). Can't we use envvars there? Would be very useful
thanks
I am trying to create a user command, its parameter is a file. In the Parameters field, I select a file, with its absolute path, the command works fine.
If I change the path so that it contains an environment variable, the command does not work anymore (does nothing). Can't we use envvars there? Would be very useful
thanks
You have to use double % characters in the Parameters field.
%TEMP% -> %%TEMP%%
%TEMP% -> %%TEMP%%
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
understood, thanks. A pity as I use envvars everywhere but even without that, it is working great.MVV wrote:jmwap, it will only work if program to be started supports envvars in parameters. You can't specify envvar to be expanded by TC in a Parameters field. However you can specify some parameters with envvars in Command field after path to program (w/o doubling % characters) and TC will expand them.
- ghisler(Author)
- Site Admin
- Posts: 50865
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Try putting the parameters in the command field, e.g.
"c:\windows\notepad.exe" "%homedir%\filename.txt"
TC will resolve env vars in the command field, and placeholders in the parameters field.
"c:\windows\notepad.exe" "%homedir%\filename.txt"
TC will resolve env vars in the command field, and placeholders in the parameters field.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
in my case what I want to run is an TC internal command, so I tried:ghisler(Author) wrote:Try putting the parameters in the command field, e.g.
"c:\windows\notepad.exe" "%homedir%\filename.txt"
TC will resolve env vars in the command field, and placeholders in the parameters field.
OPENTABS %TEMP%\t.tab
but it does not work. In this case is not big deal for me as I can live with an absolute path anyway
thanks
2jmwap
It works fine here - are you sure you remembered to put the t.tab file in the TEMP directory?OPENTABS %TEMP%\t.tab
but it does not work.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar