TC config files location in admin mode

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

TC config files location in admin mode

Post by *JanuszJ »

I have moved my ini files (using inireloc) to my folder and they work fine. But when I start TC as administrator TC does not seem to read tool bar configuration (default.bar) from that folder but from program folder. As a result I have a different tool bar when running TC normally and with "Run as administrator" command. Which is kind of strange, because both instances in Help>About Total Commander ... display the same localization of ini files.

Can this behavior be changed (so that in both modes the same default.b* file will be used) or should I copy my configuration files from my private folder back to program folder.

PS
TC is a great program!
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: TC config files location in admin mode

Post by *MVV »

Usually TC tries to use button bar file from INI, but if it is read-only, it uses its copy in AppData directory. So I would expect that in your case elevated TC uses buttonbar file from TC folder and non-elevated TC uses its copy from AppData folder, not the one that you've selected in buttonbar options.
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

Re: TC config files location in admin mode

Post by *JanuszJ »

Thank you for your answer!

You wrote about ini file being read-only, I do not think that may be reason: if I can open the file as regular user I should be able to open it also (or even more) with admin rights. In fact it is the reason that I start sometimes TC in admin mode: to be able to access all files in my system without any additional system questions and pop-ups.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: TC config files location in admin mode

Post by *sqa_wizard »

JanuszJ: Use inireloc once more with user defined location, but this time set option "For all users".
#5767 Personal license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: TC config files location in admin mode

Post by *MVV »

I talk about BAR file: you should check which one non-elevated TC uses, because when TC can't write to program folder, it uses BAR file copy in AppData\Local\GHISLER folder.
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

Re: TC config files location in admin mode

Post by *JanuszJ »

sqa_wizard wrote: 2019-10-01, 20:26 UTC JanuszJ: Use inireloc once more with user defined location, but this time set option "For all users".
Thank you for your answer!

But unfortunately it did not work. I tried it even again, this time invoking inireloc with admin rights, again no success. I mean inireloc executed properly, but still there are two different button bars: one for invoking TC as a regular user, second when I invoke it with 'Run as administrator'.

I think that it did not help because in Windows even in admin mode I do not change my identity, I am still the same user but with less restricted access rights.

Best regards
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

Re: TC config files location in admin mode

Post by *JanuszJ »

MVV wrote: 2019-10-02, 19:08 UTC I talk about BAR file: you should check which one non-elevated TC uses, because when TC can't write to program folder, it uses BAR file copy in AppData\Local\GHISLER folder.
Thank you for your answer! These files are not read-only. Neither are they in the program folder.

Here is a screenshot showing two instances of TC (regular and elevated one) with different button bars, listing of the folder showing that none of the files within it is read only and Help window from the elevated instance of TC showing that it at least tries to read files from this very folder:

https://drive.google.com/file/d/1kPdTHd5wV68HGZGMO5u_LxGDAms6OJ98/view
(As it looks like image uploading is switched off on this forum I leave here a link to the screen shot. Should work.)

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

Re: TC config files location in admin mode

Post by *petermad »

2JanuszJ
These files are not read-only
Even though a file does not have the file attibue read-only, there can still be restriction to the use via the NTFS system. Right click on the file - choose Properties - click on the tab Security - then you can see the permissions for the different type of users.
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
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

Re: TC config files location in admin mode

Post by *JanuszJ »

petermad wrote: 2019-10-07, 10:34 UTC 2JanuszJ
These files are not read-only
Even though a file does not have the file attibute read-only, there can still be restriction to the use via the NTFS system. Right click on the file - choose Properties - click on the tab Security - then you can see the permissions for the different type of users.
Thank you for your hint! I found a partial solution. But it is counter intuitive, hence it would be nice if TC in new version would work slightly differently.

Solution:
I changed the write attribute of the c:\Program Files\totalcmd\DEFAULT.BAR to Deny for the administrators group. Now TC loads the same button bar in both modes (normal and run as an administrator).

Description:
I used Sysinternals tools to monitor TC behavior when it starts its execution. It reads the ini file from my private directory (as it is supposed to), but then it tries to open for writing the default.bar file in the program (and not my) directory which is weird. When it is invoked without admin rights it fails to open that file in program folder (of course) and only then it tries to open the default.bar in my private directory (and succeeds and opens the button bar I have created). On the other hand when it is invoked with 'Run as administrator" command it succeeds in opening for writing the default.bar in the program folder (which is fine and may be needed for some reasons) but then it doesn't even try to read the customized default.bar in my private folder. Which is kind of strange - in my opinion the customized button bar should take precedence over the default one.

Thanks everybody who posted answers to my post! For the time being the problem is solved but - in my opinion - it would be great if a new version of TC would prefer in both (admin and regular) modes the customized default.bar file stored in the private directory over that one from the program folder.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC config files location in admin mode

Post by *petermad »

2JanuszJ
Another solution is that you just use another .bar file as your default bar - that's what I do and it works perfectly. So copy your default.bar file to for example mybar.bar and place it in your private directory, then change your bar file accordingly from the "Change button bar" dialog (the top field). And then anwer yes to the question:
Do you want to make this button bar permanent?
It will then be loaded each time Totalcmd is started.
which pops up when you press OK in the "Change button bar" dialog
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
JanuszJ
Junior Member
Junior Member
Posts: 6
Joined: 2019-09-29, 19:10 UTC

Re: TC config files location in admin mode

Post by *JanuszJ »

Hi petermad,
great solution! Works for both admin and regular user.
Thank you!
Post Reply