Pseudo variables requires capitalized first letter

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Pseudo variables requires capitalized first letter

Post by *petermad »

For some reason these works in buttons and in commandline:
cd %$LOCAL_APPDATA%
cd %$Local_appdata%
cd %$Local_Appdata%
cd %$LOcal_appdata%

But all lowercase like this:
cd %$local_appdata%
does not work, but generates a Read error when used in a button, and just do nothing from command line.

It is the same with for example cd %$downloads% wich doesn't work wheras cd %$Downloads% works.
04.08.17 Added: Windows Vista and newer: Support new pseudo environment variables described here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx. Leave out prefix FOLDERID_, e.g. FOLDERID_Downloads -> %$Downloads% . Only fields with "Default Path" option are supported (32/64)
It is not new, it also happens in TC 8.52a

Is it a bug or a feature that the first letter after $ has to be capitalized?

It works fine with normal environment variables like:
cd %localappdata%
Last edited by petermad on 2018-06-20, 21:31 UTC, edited 3 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

petermad,
IIRC it's by design to avoid some conflict. Don't remember what kind of conflict, though.
Glad to have been of help! :D

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is intentional because you can actually name a real environment variable $LOCAL_APPDATA!

e.g. via command line:
set $LOCAL_APPDATA=test
set $LOCAL_APPDATA

returns:
$LOCAL_APPDATA=test

Since environment variables are case insensitive, I have decided to get the real environment variable with %$local_appdata%, and the special value with %$LOCAL_APPDATA%. Only the first character is checked for upper/lowercase.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I have decided to get the real environment variable with %$local_appdata%, and the special value with %$LOCAL_APPDATA%.
Maybe you should add that info to the Help page about Environment variables.

Ans maybe change the text:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$name%
to:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$NAME%
And:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$name%
to:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$Name%
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I added a comment to the help in RC1.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

OK, I added a comment to the help in RC1.
Great. :) But maybe you should also add:

"(at least the first character must be uppercase)"

to the section as well:

"4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath."

since it also applies to that.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I was sure you would complain about that! But I prefer not to repeat it there because it's redundant.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I was sure you would complain about that!
:lol:
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

For some reason on the env_vars.htm Help page there is an empty line between:

Music,
and
NetHood,

because of a bevildered <span class="s55"> </span> tag.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, there was a TAB character in that location, no idea how it went there. I will remove it.
Author of Total Commander
https://www.ghisler.com
Post Reply