Hi everyone,
Is it possible to use (environment) variables/placeholders for the RedirectSection=<ininame> setting?
I'd like to put several sections of the .ini into user-specific files dependant on the account they're logged onto.
So "RedirectSection=%commanderpath%\settings_%user%.ini" would be changed to "RedirectSection="c:\program files\settings_KyleK.ini"
Variables in RedirectSection?
Moderators: Hacker, petermad, Stefan2, white
Hm,
I tried:
RedirectSection=wincmd_%USERNAME%.ini
RedirectSection=wincmd_%USER%.ini
RedirectSection=wincmd_%USERPROFILE%.ini
(though the last one was a mistake by me, it makes no sense at all).
None of these work. Checking file access with SysInternal's Filemon, Total Commander tries to open the file "wincmd_%USERNAME%.ini"
The variable does not get resolved.
Am I doing something wrong?
I tried:
RedirectSection=wincmd_%USERNAME%.ini
RedirectSection=wincmd_%USER%.ini
RedirectSection=wincmd_%USERPROFILE%.ini
(though the last one was a mistake by me, it makes no sense at all).
None of these work. Checking file access with SysInternal's Filemon, Total Commander tries to open the file "wincmd_%USERNAME%.ini"
The variable does not get resolved.
Am I doing something wrong?
2KyleK
BTW: I personally use %appdata% to load TC (totalcmd.exe /i=%appdata%\tc.ini) so I don't have to mess around with per user settings in redirectsection.
Developer summary: This is a bug because ExpandEnvironmentStrings expands also these kind of paths. I have tested it.
Indeed these examples really doesn't work although they should. It seems environment strings are only supported if the result is an absolute path. Use absolute paths for the time being.RedirectSection=wincmd_%USERNAME%.ini
RedirectSection=wincmd_%USER%.ini
BTW: I personally use %appdata% to load TC (totalcmd.exe /i=%appdata%\tc.ini) so I don't have to mess around with per user settings in redirectsection.
Developer summary: This is a bug because ExpandEnvironmentStrings expands also these kind of paths. I have tested it.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Actually it does work, but when you give no absolute path, the files will be found in the Windows directory (where you probably don't have write access).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com