Environment variable not resolved for menu bar [RC5 64 bit]
Moderators: white, Hacker, petermad, Stefan2
Environment variable not resolved for menu bar [RC5 64 bit]
Hi,
This is my command:
https://www.dropbox.com/s/gdpe5xac3gxg0r7/2022-10-25%2018_19_43-Total%20Commander%2010.52RC5%20-%20Umgebungsvariable.png?dl=0
The "%$DESKTOP%" is not resolved.
https://www.dropbox.com/s/40titclec948ye7/2022-10-25%2018_20_16-Process%20Monitor%20-%20Sysinternals_%20www.sysinternals.com.png?dl=0
When entering "%$DESKTOP%" as a path directly into the tab, TC changes to my desktop.
According to the context help in this window (F1), environment variable are supposed to work. Any ideas?
Best Regards,
Alex
This is my command:
https://www.dropbox.com/s/gdpe5xac3gxg0r7/2022-10-25%2018_19_43-Total%20Commander%2010.52RC5%20-%20Umgebungsvariable.png?dl=0
The "%$DESKTOP%" is not resolved.
https://www.dropbox.com/s/40titclec948ye7/2022-10-25%2018_20_16-Process%20Monitor%20-%20Sysinternals_%20www.sysinternals.com.png?dl=0
When entering "%$DESKTOP%" as a path directly into the tab, TC changes to my desktop.
According to the context help in this window (F1), environment variable are supposed to work. Any ideas?
Best Regards,
Alex
Re: Environment variable not resolved for menu bar [RC5 64 bit]
Percent signs in the parameter field need to be doubled to differentiate them from placeholder variables like %P, %N, %T and so on. Don't double the percent signs in the command field though.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Environment variable not resolved for menu bar [RC5 64 bit]
changed to: %P%N "%%$DESKTOP%%\%O.pdf" px.cfg
this is not working, either. not resolved:
"C:\Program Files\totalcmd\plugins\wlx\ulister\demo64\exsimple.exe" "C:\Program Files\totalcmd\plugins\wlx\ulister\readme.txt" "%$DESKTOP%\readme.pdf" px.cfg
this is not working, either. not resolved:
"C:\Program Files\totalcmd\plugins\wlx\ulister\demo64\exsimple.exe" "C:\Program Files\totalcmd\plugins\wlx\ulister\readme.txt" "%$DESKTOP%\readme.pdf" px.cfg
Re: Environment variable not resolved for menu bar [RC5 64 bit]
Environment variables are only supported in the Command field. These get replaced by Total Commander.
As explained by Dalai you can pass the environment variable unevaluated by doubling the percent signs. It's then up to the program that is run to replace the environment variable. It's unlikely that exsimple.exe supports the use of %$DESKTOP%. If exsimple supports normal environment variables, this might work:
As explained by Dalai you can pass the environment variable unevaluated by doubling the percent signs. It's then up to the program that is run to replace the environment variable. It's unlikely that exsimple.exe supports the use of %$DESKTOP%. If exsimple supports normal environment variables, this might work:
Code: Select all
%P%N "%%UserProfile%%\Desktop\%O.pdf" px.cfg
Re: Environment variable not resolved for menu bar [RC5 64 bit]
I see, it's up to the according program to expand the variable. well, not working for me in this example. :/
It is strange that I can't refer to the desktop, i.e. that TC is not expanding the variable.
It is strange that I can't refer to the desktop, i.e. that TC is not expanding the variable.
Re: Environment variable not resolved for menu bar [RC5 64 bit]
This is entirely impossible, because it is an internal variable TC.
If the author wanted to re-read the second line with the disclosed parameters again as part of the "Command:" field, then there would be no such problem.
The reason why this did not happen was, as far as I remember, that the names of files and folders can also contain text with variable names (Example: D:\blabla%temp%blabla\$%Destop%\%windir%blabla.txt).
As a workaround, you can use nircmd:
Command: %COMMANDER_PATH%\Utils\NirCmd\nircmd.exe exec show exsimple.exe
Paramenters: %P%N "~$folder.desktop$\%O.pdf" px.cfg
Overquoting is evil! 👎
Re: Environment variable not resolved for menu bar [RC5] - solved
Thanks. Working with "%COMMANDER_PATH%\plugins\util\nircmd\nircmdc.exe execmd exsimple.exe"
one tool more in my toolbox
one tool more in my toolbox
Re: Environment variable not resolved for menu bar [RC5 64 bit]
2adoeller
Why do you need a hidden cmd.exe process?
If exsimple needs to be hidden, then write hide instead of show.
Why do you need a hidden cmd.exe process?
If exsimple needs to be hidden, then write hide instead of show.
Overquoting is evil! 👎
Re: Environment variable not resolved for menu bar [RC5 64 bit]
With the argument "show" exsimple.exe simply wasn't working. That's why I omitted "show" .
Re: Environment variable not resolved for menu bar [RC5 64 bit]
Are you sure you have an "exec show exsimple.exe ", not "execmd show exsimple.exe "?
For example: nircmd.exe exec show cmd /c start "" ~$folder.desktop$
The command will execute cmd, which will open the Desktop folder.
For example: nircmd.exe exec show cmd /c start "" ~$folder.desktop$
The command will execute cmd, which will open the Desktop folder.
Overquoting is evil! 👎
Re: Environment variable not resolved for menu bar [RC5 64 bit]
It's execmd. Not suitable for my purpose?
Re: Environment variable not resolved for menu bar [RC5 64 bit]
I write that instead of execmd it is better to use exec hide, because it does not create an intermediate console process.
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 48021
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Environment variable not resolved for menu bar [RC5 64 bit]
Indeed you can only use environment variables in the command field (which also accepts parameters), and only placeholders like %N in the parameters field, because the two would otherwise interfere with each other.
For example, %P%N could be interpreted as placeholders %P and %N, or as environment variable %P% and character N.
For example, %P%N could be interpreted as placeholders %P and %N, or as environment variable %P% and character N.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Environment variable not resolved for menu bar [RC5 64 bit]
>>>ghisler(Author) wrote: ↑2022-10-26, 08:49 UTC because the two would otherwise interfere with each other.
Parameters: %P%N %%ProgramFiles%%\Folder
Read for the first time: C:\Path\to\file.ext %ProgramFiles%\Folder
Read it a second time: C:\Path\to\file.ext C:\Program Files\Folder
Last edited by Fla$her on 2022-10-26, 18:20 UTC, edited 2 times in total.
Overquoting is evil! 👎
Re: Environment variable not resolved for menu bar [RC5 64 bit]
2ghisler(Author)
You can simply enter a rule to fill this field, if necessary, with environment variables only in special quotation marks.
And then no confusion.
You can simply enter a rule to fill this field, if necessary, with environment variables only in special quotation marks.
And then no confusion.
#146217 personal license