How to run a command (using no elevation) from an elevated TC?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

Hi, I need to run a command from a TC button bar.

This is the command:
explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons

It keeps failing, but after some troubleshooting and investigation I managed to know the cause of the problem: I run TC using admin rights, but this command seems to work only if I run it without admin rights.

So, is there a way to run a command with no admin rights from a TC that is using admin rights?

I've tried to use a BAT file including a command to decrease rights: runas /trustlevel:0x20000 and then the command I need to run, but it also fails :(

Any clue about this?

Thanks!
I Love Total Commander!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6981
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to run a command (using no elevation) from an elevated TC?

Post by *Horst.Epp »

The simple solution is to stop running TC as Admin.
This is in no way necessary for normal work.
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
User avatar
HerbieH
Member
Member
Posts: 154
Joined: 2003-02-11, 10:04 UTC

Re: How to run a command (using no elevation) from an elevated TC?

Post by *HerbieH »

Use this:

Code: Select all

nircmd64.exe runas [your windows username] [password] explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons
It works for me. :)

'Nircmd' is a freeware utility from Nir Sofer. It is very easy to find, and I have used it for years. Works with Windows 7, 8.1 and 10 (all versions)


To *Horst.Epp »
Wow! Please stop talking to people like they were 4 years old
Really... !
HerbieH*
-Keep on makin' music!
NotNull
Senior Member
Senior Member
Posts: 298
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: How to run a command (using no elevation) from an elevated TC?

Post by *NotNull »

HerbieH wrote: 2021-01-07, 21:22 UTC To *Horst.Epp »
Wow! Please stop talking to people like they were 4 years old
Really... !
He has a very valid point here (could be formulated differently, though).

On topic:

On a Win10 systmem, if you run something "through" Explorer, it will be run under the usercredentials of the logged on user.

So yo can create a button with:
Command = explorer.exe
Parameters = shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons

When this button is activated in an elevated TC, it will open this shellfolder UNelevated.


BTW: nirsoft also has AdvancedRun.exe. That is even beter suited to run applications under different credentials. (I use it -for example - to run CMD under TrustedInstaller credentials)
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

Thanks, HerbieH. I know NirCMD! I use it, but I forgot to mention that I use TC mostly as portable (on a USB drive) in several machines, so it won't work properly if it needs user credentials, which will difer from one PC to another.

Thanks, NotNull. I tried your suggestion, but it just opens an Explorer window showing Documents folder. So, it is not working :(
I Love Total Commander!
lezerogan2
Junior Member
Junior Member
Posts: 84
Joined: 2010-04-19, 15:50 UTC

Re: How to run a command (using no elevation) from an elevated TC?

Post by *lezerogan2 »

runas /trustlevel:0x20000 "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons"
is working for me.
maybe the quotes are missing?
Latest windows 10 home 64bit. TC 9.51 64bit elevated
User avatar
tuska
Power Member
Power Member
Posts: 4060
Joined: 2007-05-21, 12:17 UTC

Re: How to run a command (using no elevation) from an elevated TC?

Post by *tuska »

BUTTON

Code: Select all

TOTALCMD#BAR#DATA
explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons

wciconex.dll,34
explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons|Enable or disable system icons (clock, volume, microphone, etc.)|https://www.ghisler.ch/board/viewtopic.php?f=3&t=73619


-1

Code: Select all

These are my test results with the given button:

TC_clean 9.51 (x64).ini as ADMIN .. OK
TC_clean 9.51 (x86).ini as ADMIN .. NOK (Not OK)
         .. 
TC_clean 9.51 (x64).ini ........... OK
TC_clean 9.51 (x86).ini ........... NOK (Not OK)
2sidefx88
Please specify the exact TC and Windows version (example: pls see below...).
Maybe someone can give you more help then.


Windows 10 Pro (x64) Version 20H2 (OS build 19042.685) [... press Windows logo key + pause key]
... started as normal user ...
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

Thanks, lezerogan2

I just tried that, but it opens an Explorer window showing Documents folder :(

I´m on Windows 10 Pro x64 20H2 - TC 9.51 32-bit elevated
I Love Total Commander!
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

Thanks, tuska

I´m on Windows 10 Pro x64 20H2 - TC 9.51 32-bit elevated

Maybe it is because I´m using TC 32-bit on a x64 Windows?
I Love Total Commander!
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

Just tried the folowing command on TC x64 and it works fine!
runas /trustlevel:0x20000 "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons"


Any clue on how to make this work on TC 32-bit?

Thanks in advance.
I Love Total Commander!
User avatar
tuska
Power Member
Power Member
Posts: 4060
Joined: 2007-05-21, 12:17 UTC

Re: How to run a command (using no elevation) from an elevated TC?

Post by *tuska »

sidefx88 wrote: 2021-01-07, 23:45 UTC I´m on Windows 10 Pro x64 20H2 - TC 9.51 32-bit elevated
Maybe it is because I´m using TC 32-bit on a x64 Windows?
No, it is because when using the button in TC 32bit only the Windows Explorer opens.
Regardless of whether with or without admin rights, the desired window cannot currently be opened in TC 32bit.


Sorry! :?

Thanks to petermad!
(See button below...)
Last edited by tuska on 2021-01-08, 00:41 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16034
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to run a command (using no elevation) from an elevated TC?

Post by *petermad »

2sidefx88

Try this button:

Code: Select all

TOTALCMD#BAR#DATA
*%windir%\explorer.exe
shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons
%COMMANDER_EXE%,3
Edit System Icons


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".

It works for me in 32bit TC 9.51 in both elevated and unelevated state. Tested with Windows 7 and 10.
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
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

2petermad: thanks a lot! It worked fine :)
I Love Total Commander!
User avatar
petermad
Power Member
Power Member
Posts: 16034
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to run a command (using no elevation) from an elevated TC?

Post by *petermad »

2sidefx88

I found out, that you don't even need the asterisk in front of the command (to run explorer elevated) - the culprit is to run explorer.exe from the windows path (%windir%). - so this works too:

Code: Select all

TOTALCMD#BAR#DATA
%windir%\explorer.exe
shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons
%COMMANDER_EXE%,3
Edit System Icons


-1
and then you don't get a UAC promt when running TC non-elevated.

It turns out that it works with %windir%\explorer.exe (C:\windows\explorer.exe), while it does not work with C:\Windows\SysWOW64\explorer.exe - and if you only state explorer.exe, the system will use C:\Windows\SysWOW64\explorer.exe when run from a 32 bit application.
Last edited by petermad on 2021-01-09, 09:30 UTC, edited 1 time in total.
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
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: How to run a command (using no elevation) from an elevated TC?

Post by *sidefx88 »

2petermad:

Thanks for the update and for the explanation. It all makes sense now!
I Love Total Commander!
Post Reply