Page 1 of 1

Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 14:41 UTC
by cpp64
A different color theme is very useful when TC starts as an Administrator.

I use a different color theme when starting TC as an Administrator with a different wincmd.ini using *.lnk.

[*.lnk]
TOTALCMD64.EXE /i:"[path-to-another-wincmd-ini]"
with "Run as Administrator" in the *.lnk property.

I think the Admnistrator Color Theme will also be very useful for others when TC starts as an Administrator.

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 15:02 UTC
by HolgerK
This can easily be achieved by using the environment variable %SESSIONNAME% (empty string as Admin, "Console" as normal User),
Just redirect these sections in your wincmd.ini:

Code: Select all

[Colors]
RedirectSection=%COMMANDER_INI%\..\Colors_%SESSIONNAME%.INI
[ColorsDark]
RedirectSection=%COMMANDER_INI%\..\Colors_%SESSIONNAME%.INI
Kind regards
Holger

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 15:35 UTC
by Sir_SiLvA
cpp64 wrote: 2023-05-24, 14:41 UTC I think the Admnistrator Color Theme will also be very useful for others when TC starts as an Administrator.
I disagree and think the ^ in the titlebar is enough.
How about adding TitleExtraText=$I AM THE ADMIN! into the wincmd.ini under [Configuration]
so you can see at first glance that your the Admin? :D

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 15:54 UTC
by HolgerK
How about changing your windows username to "I AM THE ADMIN!"
;-)
Holger

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 16:17 UTC
by Sir_SiLvA
2HolgerK
that would make his Titlebar a bit full wouldnt it?
I AM THE ADMIN!^ - TC 11.00b3 - unregistered - I AM THE ADMIN!
yep I dont think he would see that he has startet tc as admin that way :D

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 16:18 UTC
by cpp64
Sir_SiLvA wrote: 2023-05-24, 15:35 UTC I disagree and think the ^ in the titlebar is enough.
How about adding TitleExtraText=$I AM THE ADMIN! into the wincmd.ini under [Configuration]
so you can see at first glance that your the Admin? :D
I use multiple TCs in 4k 43 inch monitor with the maximized window with virtual desktops.

It's so annoying to look at the top left corner of each TC or the title bar of each cmd to tell if I'm the Administrator all in the same color.

Different Color and diffrent prompt when i am the Administrator is really essential for me.

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 17:14 UTC
by Sir_SiLvA
HolgerK wrote: 2023-05-24, 15:54 UTC Where do you see the repetition of the username at the end of the title?:-)
Ist your TC registered to "unregistered - I AM THE ADMIN!"?
It should look like "I AM THE ADMIN!^ - TC 11.00b3 (x64) - Holger K..."
The left "I AM THE ADMIN!" is the USERNAME, the right "I AM THE ADMIN!" comes from
the wincmd.ini-entry TitleExtraText=$I AM THE ADMIN!
HolgerK wrote: 2023-05-24, 15:54 UTC NOT REGISTERED = unregistered.
Sorry but that is literally the same :D

@cpp64:
So then use HolgerKs example and make for example the background of admins black?

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 17:29 UTC
by cpp64
Sir_SiLvA wrote: 2023-05-24, 17:14 UTC So then use HolgerKs example and make for example the background of admins black?
I tried.

But TC creates real colors_%SESSIONNAME%.ini file, not colors_.ini when SESSIONNAME is not defined.

When I open the real colors_%SESSIONNAME%.ini file using an app, the app opens colors_Console.ini, not real colors_%SESSIONNAME%.ini file.

Since SESSIONNAME is not defined when in Admin, it doesn't seem appropriate to use SESSIONNAME in TC.

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 17:46 UTC
by HolgerK
Yepp, it's a little bit confusing that the filename "colors_%SESSIONNAME%.ini" contains an environment variable and some editors tries to expand these variable to "Console" but that shouldn't hinder TC to use the correct ini file.
I'm using this solution for more than 10 years without any problems (normal panel background dark blue, admin panel background dark red).

BTW: Notepad.exe or Notepad++.exe should open the "colors_%SESSIONNAME%.ini" without problem.

Regards
Holger

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 18:03 UTC
by cpp64
2HolgerK

Thanks for the SESSIONNAME tip.

I created a simple batch command.

@if defined SESSIONNAME (echo user) else (echo admin).

This is very useful for me because cmd shows the same prompt when in Admin.

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 19:32 UTC
by HolgerK
As for Command Prompt: this could be made easier using the following registry entry to colorize the elevated command processor window:

Code: Select all

REGEDIT4

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor]
"Autorun"="@whoami /groups | @find /i \"S-1-16-12288\" >nul && @color 4E"
the first nibble "4" is used for the background color
the second nibble "E" is used for the foreground color
In this case: dark red background + bright yellow foreground
Color codes

Code: Select all

0 black
1 blue
2 green
3 cyan
4 red
5 magenta
6 yellow/brown
7 white
8 gray
9 bright blue
A bright green
B bright cyan
C bright red
D bright magenta
E bright yellow
F white
Regards
Holger

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 20:16 UTC
by cpp64
2HolgerK
HolgerK wrote: 2023-05-24, 19:32 UTC "Autorun"="@whoami /groups | @find /i \"S-1-16-12288\" >nul && @color 4E"
------------------------------------------------------------
"AutoRun"="@if not defined SESSIONNAME (prompt [Administrator]$p$g)"
------------------------------------------------------------

Thank you for your interest.


------------------------------------------------------------
ps.

'color xxx' changes the color of the Windows terminal to a different color, not the same as cmd.

Re: Administrator Color Theme is required when TC starts as an Administrator.

Posted: 2023-05-24, 21:10 UTC
by HolgerK
"'color xxx' changes the color of the Windows terminal to a different color, not the same as cmd."
this depends on "Terminal -> Settings -> Command Prompt -> Appearance -> Color scheme"
to use the original cmd color scheme (matching the previous mention color codes) you must select "Vintage"

HTH
Holger