Why the system variable %username% does not work?
Moderators: Hacker, petermad, Stefan2, white
Why the system variable %username% does not work?
Hi
Why the system variable %username% does not work?
ex
[right]
path=C:\Users\%username%\Work
Why the system variable %username% does not work?
ex
[right]
path=C:\Users\%username%\Work
Re: Why the system variable %username% does not work?
Works here in directory hotlist
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Re: Why the system variable %username% does not work?
PiotrMP6 wrote: 2021-07-20, 11:28 UTC Hi
Why the system variable %username% does not work?
ex
[right]
path=C:\Users\%username%\Work
What do you try to do?
Me think that setting is written by TC itself on saving the settings.
Re: Why the system variable %username% does not work?
It doesn't work because it is not implemented in [right] section of wincmd.ini.
"War is evil, in so far as it makes more bad people than it takes away."
Immanuel Kant in "Perpetual Peace"
Immanuel Kant in "Perpetual Peace"
Re: Why the system variable %username% does not work?
Who edits the [Left] or [Right] entries by hand, for what reason ?norfie² wrote: 2021-07-21, 07:50 UTC It doesn't work because it is not implemented in [right] section of wincmd.ini.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Re: Why the system variable %username% does not work?
It could be useful if the option "Save on exit - Directories"is disabled and one prefer to start with the %username% folder.Who edits the [Left] or [Right] entries by hand, for what reason ?
"War is evil, in so far as it makes more bad people than it takes away."
Immanuel Kant in "Perpetual Peace"
Immanuel Kant in "Perpetual Peace"
Re: Why the system variable %username% does not work?
You can use:
to start in the virtual folder \\Username\ which of course is not quite the same as the physical forder c:\Users\Username\
Code: Select all
[right]
path=::{59031a47-3f72-44a7-89c5-5595fe6b30ee}
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Why the system variable %username% does not work?
Horst.Epp wrote: 2021-07-21, 08:51 UTC Who edits the [Left] or [Right] entries by hand, for what reason ?
For example for to copy a ready made wincmd.ini to other users for the very first start, or for a live-CD (Windows PE, like BartPE)
There are more possibilities one could suppose.
Re: Why the system variable %username% does not work?
Only for the first start of a new user I see a usage.
I used BartPE bevor WinPE for years and there is no username or login necessary for both.
I just copy my portable TC installation onto the CD and use it without problems.
Now the same for WinPE with USB sticks as media.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
- ghisler(Author)
- Site Admin
- Posts: 50550
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Why the system variable %username% does not work?
The reason is that a directory name like C:\Users\%username%\Work is perfectly allowed. So in path fields saved by TC, environment variables will not be replaced unless the path itself is invalid. For example, you can use
right=%userprofile%\Work
Because it's not a valid path with % at the start.
If Total Commander is installed on C, you can use somthing like this:
path=%commander_drive%\users\%username%\Work
right=%userprofile%\Work
Because it's not a valid path with % at the start.
If Total Commander is installed on C, you can use somthing like this:
path=%commander_drive%\users\%username%\Work
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Why the system variable %username% does not work?
2ghisler(Author)
Except it will not work with IgnoreDirErrors=1For example, you can use
right=%userprofile%\Work
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Why the system variable %username% does not work?
2ghisler(Author)
Can you confirm this finding?petermad wrote:Except it will not work with IgnoreDirErrors=1
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50550
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Why the system variable %username% does not work?
Yes, this happens because TC only tries to replace the environment variable when an error occurs. The problem here is that the function used also handles relative directories, which can contain the % character too.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Why the system variable %username% does not work?
2ghisler(Author)
Could that be fixed eventually with a third option:
2: As 1 but switch to directories that starts with (or better contains) an environment variable.
Could that be fixed eventually with a third option:
2: As 1 but switch to directories that starts with (or better contains) an environment variable.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50550
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Why the system variable %username% does not work?
"Starts with" should be possible, but "contains" will be a problem because a directory can actually be named %variablename%.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com