TC can request administrator privilege and elevate current process as administrator when necessary, and then return to normal privilege after a while. However, this only works for certain predefined tasks, but could not be used for certain fs plugins that require administrator privilege to work properly, eg. ext4plugin, Registry (for editing), Task Manager (to kill some processes), etc.
I tried to run TCMADM64.EXE within TC, but it says that it is internal to TC and cannot be called directly. So I have to start another TC process with administrator privilege to complete the work inconveniently. It would be great if we can trigger the prompt explicitly with a shortcut, a button, or an internal cm_* command ideally.
Elevate current TC process as administrator explicitly
Moderators: Hacker, petermad, Stefan2, white
Re: Elevate current TC process as administrator explicitly
Create a button like this
It starts an enhanced instance of the current TC in the same pathes.
With this you can then run any plugin or other tools with enhanced rights.
Exit this TC when you are finished.
Code: Select all
TOTALCMD#BAR#DATA
*%COMMANDER_EXE%
%Z/N %X"%P" "%T"
%COMMANDER_PATH%\TCMADM64.EXE
TC x64 as Admin
0
-1
With this you can then run any plugin or other tools with enhanced rights.
Exit this TC when you are finished.
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
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
Re: Elevate current TC process as administrator explicitly
How to create such a button?
Will this revoke the admin privilege automatically after a while as defined in AdminTimeout?
Will this revoke the admin privilege automatically after a while as defined in AdminTimeout?
Re: Elevate current TC process as administrator explicitly
Its your decision.atbest wrote: 2021-08-15, 13:34 UTC Will this revoke the admin privilege automatically after a while as defined in AdminTimeout? If not, it is dangerous and I will not use this method.
Personaly I always know what mode I'm running and its shown in the title bar.
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
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
Re: Elevate current TC process as administrator explicitly
I understand your code now. It is actually the same with what I said "I have to start another TC process with administrator privilege to complete the work" in my initial post -just use a different icon.