How can I run em command as an administrator without using the toolbar

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ruizrzr1
Junior Member
Junior Member
Posts: 37
Joined: 2022-07-06, 06:39 UTC

How can I run em command as an administrator without using the toolbar

Post by *ruizrzr1 »

:?:
User avatar
nsp
Power Member
Power Member
Posts: 1802
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How can I run em command as an administrator without using the toolbar

Post by *nsp »

You cannot run as administrator a user command if TC is not already running elevated.
You can run an external command elevated inside a user command.

To call a user command, you can run it as an alias, a hotkey, a button in a bar. You can also use a program to call it using wm_copydata message.
User avatar
Stefan2
Power Member
Power Member
Posts: 4124
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How can I run em command as an administrator without using the toolbar

Post by *Stefan2 »

You can build an EM command to launch a program with administrative rights by prefixing the command by an asterisk.


Here an example found at petermads' Extended Total Commander Menus
https://www.ghisler.ch/board/viewtopic.php?t=33740

[em_ext_cmdelevated]
cmd=*%COMSPEC% /C
param=Start /D"%P"
menu=Command Prompt as Administrator
button=cmd.exe



More info:
Right click an button at the buttonbar > Change... >> [Help] >>> and read at "Command: 1."
Put an asterisk '*' in front of the name to start it with administrative rights, or two '**' to start is as a different user



Next you can assign a keyboard shortcut to such an em_command (or cm_command)
via Options > Misc.       for to use it w/o the need of creating an button.



 
Post Reply