systemvariables as parameter in buttonbar bug

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

systemvariables as parameter in buttonbar bug

Post by *Sheepdog »

If I make a Button and want to pass a parameter as systemvariable e.g. %commander_path% or %windir% and place it in the parameter field TC passes instead "%Commander_path%" "'ommanderpath" and removes the following backslash.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

As far as I know the parameter field is thought for internal variables only. It will work fine for other command line parameters as long as you don't try to use the percent character. TC will always try to expand these internal parameters. I always set command line parameters in the command field if possible.
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 14-10-2004 01:34:35 +0000 Lefteous wrote:

L> As far as I know the parameter field is thought for
L> internal variables only. It will work fine for other
L> command line parameters as long as you don't try to
L> use the percent character. TC will always try to expand
L> these internal parameters.


OMG...

%%TEMP%%

That's basic thing from help:

_________transmission_from_TOTALCMD.HLP___________

%% inserts the percent-sign.

_______________end_of_transmission________________[/face]
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Lefteous
Thanks. You are right. Moving parameters into command line helps (eg. with bars and %commander_path%) in TCMenu.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

I made a button with:

Code: Select all

Commandline: Textpad.exe
parameter: %%Commander_path%%\ini\%%username%%\wincmd.ini
and Textpad still does not find the file. If I use:

Code: Select all

Commandline: Textpad.exe %Commander_path%\ini\%username%\wincmd.ini
parameter: 
It works perfectly fine.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Black Dog
Thanks, I didn't know that!
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Post by *nevidimka »

Another workaround for this different behavior of environment variables

Code: Select all

Command: %comspec%
Parameters: /c @start notepad %%Commander_path%%\DEFAULT.BAR
This is useful if you need additional parameters like %N, %M, %O, %E. :D

2Christian Ghisler
In "Command": environment variable will be replaced with the proper content of this variable;
in "Parameters": no replacement of environment variables will be realized (except the replacements by TC like double %% to single %, %N ...)
:?: What are the reasons for this different behavior of environment variables in "Command" and "Parameters"?
The doorstep to the temple of wisdom is a knowledge of our own ignorance. Benjamin Franklin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is that the parameters field uses special variables like %P or %N which are incompatible with environment variables...
Author of Total Commander
https://www.ghisler.com
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 14-10-2004 13:42:45 +0000 nevidimka wrote:

n> Another workaround for this different behavior of environment
n> variables


Yep, that's exactly how I managed to use it - via cmd /c start. And that's a good idea to check "Run mi&nimized" in such a case.[/face]
Post Reply