I'd like to be able to use a configuration that has a set of tabs that can be used relatively.
I'd like to be able to use a particular ini that references a user's folder branch at each invocation, irrespective of which user is current.
I see that virtual folders can be saved in an ini, e.g. \\desktop\*.* - but that, say,
c:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\ cannot.
I note that %USERNAME% can be inserted directly into the folder name line, but TC immediately translates that into the current username.
I also note that %USERNAME%, put directly into a locked tab in an ini, isn't interpreted correctly when TC is invoked. It would open a tab in the example above as:
c:\Users\
Save relative tabs?
Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
Moderators: white, Hacker, petermad, Stefan2
Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
You can use environment variables in tabs (sections [lefttabs] and [righttabs]), but the variables get translated to their current value. But you can turn off saving of tabs on exit to preserve them.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
and what the heavy reason is for this action?but the variables get translated to their current value
#146217 personal license
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
The reason is that %USERNAME% is a perfectly valid directory name which you can create with F7. However, Windows functions like CreateFile do not work when you pass environment variables to them - they will look for the real %USERNAME% and not for the translated name. This has to be done by the program beforehand.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
That's a shame that they get translated without reversion for the reasons described below. It does makes parameterising configurations less flexible.ghisler(Author) wrote: ↑2022-07-05, 06:47 UTC You can use environment variables in tabs (sections [lefttabs] and [righttabs]), but the variables get translated to their current value. But you can turn off saving of tabs on exit to preserve them.
I see that environment variables can be preserved by "turn[ing] off saving of tabs on exit" in Options | Configuration | Operation | 'Save on exit' and leaving Directories unticked.
This seems to me to leave TC sitting on a precarious edge since Options | 'Save settings' (that I have in a button and use frequently (cm_ConfigSaveSettings)) would be a verboten choice.
From another angle, having seen references to loading buttonbar buttons with folder directives, would it be possible to load a button with multiple tabs in both left and right panels (after closing all extant)?
Incorporating literal (translatable) environment variable text expressions, temporary though that would be.
A second button could be used for loading back the ini's original default set.
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
Ok, looks like ExpandEnvironmentStrings(...) or ExpandEnvironmentStringsForUser(...) func is already in useThis has to be done by the program beforehand.
BUT the question is just little bit changed - and not more - why you put at INI file ALREADY preprocessed strings?
Why not process them after reading parametrized strings from INI?
#146217 personal license
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Can TC Hold Virtual Names or Environment Variables in Tabs Configurations?
I only put them in the ini on exit.
When I load from ini, I process them so the user can change directories, otherwise the user can't change directories. For example, take variable %USERPROFILE%, it translates to c:\users\accountname. If I kept %USERPROFILE%, the user couldn't go up to c:\users. This is just one of many possible problems.
When I load from ini, I process them so the user can change directories, otherwise the user can't change directories. For example, take variable %USERPROFILE%, it translates to c:\users\accountname. If I kept %USERPROFILE%, the user couldn't go up to c:\users. This is just one of many possible problems.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com