Run As administrator

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Run As administrator

Post by *JimmyTheBroker »

Hi guys,

is there a way to make opening TC in the following location:
C:\Program Files (x86)\totalcmd
always open as "Open as administrator"?

(Other than right clicking the icon and pressing "open as administrator" and then accepting the warning prompt.)
I'm sick of always having to have to open it like this, whats a quick to this?
Thanks,

Jimmy
I finally get notifications from emails again!!!
So happy!
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, JimmyTheBroker.

Launching Total Commander in elevated mode (As Administrator) all the time is not a smart idea.
Every application which you launch from inside this elevated Total Commander will be launched with elevated rights (As Administrator) as well. (Notepad, caclulator, spreadsheet, etc pp)

Most of the time using Total Commander in normal non-elevated mode should be sufficient.

For those cases where I really need an elevated Total Commander instance, I have created a button in the main buttonbar which launches this commandline:

Code: Select all

*"%COMMANDER_EXE%" /N
Launch a new instance of Total Commander in elevated mode (As Administrator)

HTH,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Other than right clicking the icon and pressing "open as administrator"
You can set your Desktop link up to always run as administrator: Right click the Desktop icon -> "Properties" -> "Compatibility" (tab) -> "[x] Run the program as an administrator".

I suggest you do this on a copy of your normal TC link, so you have two icons - one for normal start and one for elevated start.

and then accepting the warning prompt
The only way to avoid the warning, is to turn it off (for all programs) in Windows's User Access Control (UAC) setting - "Control Panel" -> "User Accounts" -> "Change User Accounts Control settings" -> "Never notify". This is NOT recommendable!
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
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

karlchen wrote:Hello, JimmyTheBroker.

Launching Total Commander in elevated mode (As Administrator) all the time is not a smart idea.
Every application which you launch from inside this elevated Total Commander will be launched with elevated rights (As Administrator) as well. (Notepad, caclulator, spreadsheet, etc pp)

Most of the time using Total Commander in normal non-elevated mode should be sufficient.

For those cases where I really need an elevated Total Commander instance, I have created a button in the main buttonbar which launches this commandline:

Code: Select all

*"%COMMANDER_EXE%" /N
Launch a new instance of Total Commander in elevated mode (As Administrator)

HTH,
Karl
Is there a way to also close the current TC (non-admin) within this same command (or button press)? and is there a way to make it so that the new TC (with admin) will have all the same tabs open as the non-admin version?

Thanks,
Jimmy 8)
I finally get notifications from emails again!!!
So happy!
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Start separate TC instance with admin rights (Button)

Post by *tuska »

JimmyTheBroker wrote:... is there a way to make it so that the new TC (with admin) will have all the same tabs open as the non-admin version?

Code: Select all

TOTALCMD#BAR#DATA
*%COMMANDER_EXE%
%Z/N %X"%P" "%T"
%COMMANDER_PATH%\TCMADM64.EXE
TC as Admin || Start separate TC instance with admin rights... |PC name + ^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"

0
-1
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Re: Start separate TC instance with admin rights (Button)

Post by *JimmyTheBroker »

tuska wrote:
JimmyTheBroker wrote:... is there a way to make it so that the new TC (with admin) will have all the same tabs open as the non-admin version?

Code: Select all

TOTALCMD#BAR#DATA
*%COMMANDER_EXE%
%Z/N %X"%P" "%T"
%COMMANDER_PATH%\TCMADM64.EXE
TC as Admin || Start separate TC instance with admin rights... |PC name + ^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"

0
-1

Seems pretty good. Any way to make it also close the original TC as well?
I'm guessing its not possible?
I finally get notifications from emails again!!!
So happy!
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Start separate TC instance with admin rights (Button)

Post by *tuska »

JimmyTheBroker wrote:Any way to make it also close the original TC as well?
Make 2 em_commands and combine them in one button.
--> EDIT2: Make 1 em_command and combine this with 1 command (cm_Exit) in one button.

em_Run-as-Admin
Fill in the fields exactly as shown in the button above.

em_EXIT-current-TC-instance
--> EDIT1: This em_command is not necessary(!), pls see post below ... only command is required!...
Command: cm_Exit

Button with
command: em_Run-as-Admin, em_EXIT-current-TC-instance
--> EDIT2: em_Run-as-Admin, cm_Exit is correct! Please see post below ...
Icon file: %COMMANDER_PATH%\TCMADM64.EXE
Tooltip: em_Run-as-Admin, cm_Exit|viewtopic.php?t=49620

After clicking this button the
- UAC query for the new TC instance with admin rights must be confirmed
- new TC instance with admin rights opens [2] ...
- previous TC instance (without admin rights) will be closed automatically.
Last edited by tuska on 2018-03-22, 22:00 UTC, edited 2 times in total.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Start separate TC instance with admin rights (Button)

Post by *DrShark »

tuska wrote:command: em_Run-as-Admin, em_EXIT-current-TC-instance
There is no need to make a user command for cm_Exit, as an internal command it may be chained in a button command:
em_Run-as-Admin,cm_Exit
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Start separate TC instance with admin rights (Button)

Post by *tuska »

DrShark wrote:
tuska wrote:command: em_Run-as-Admin, em_EXIT-current-TC-instance
There is no need to make a user command for cm_Exit, as an internal command it may be chained in a button command:
em_Run-as-Admin,cm_Exit
Yes, you are totally right. Thanks for the hint!

Regards,
Karl
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

I think I almost have it:
However I dont think I have the "parameters" in the correct place
Not sure where to put the:
  • parameters=%Z/N %X"%P" "%T"
My usercmd.ini has:
[em_Run-as-Admin]
  • cmd=*%COMMANDER_EXE%
    menu=Opens new TC instance as Administrator.
Button bar within TC:
  • Command: em_Run-as-Admin, cm_Exit
    parameters:(greyed out)
    start path:(greyed out)
    icon: %COMMANDER_PATH%\Icons\CustomButton09.ico
default.bar
  • button99=wcmicons.dll
    cmd99=em_Run-as-Admin, cm_Exit
    menu99=TC as Admin || Start separate TC instance with admin rights... |PC name + ^ appears in title bar |*%COMMANDER_EXE% %Z/N %X"%P" "%T"

So a new TC opens up as admin, and closes the old TC, but the new TC doesnt have the same tabs open as the old TC (I think this is because I don't have the parameters, and am not sure where to put them.)
I finally get notifications from emails again!!!
So happy!
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

I have been experimenting with the parameters..

I think I need to put them in the "Choose Command" dialog box>usercmd.ini>command:em_Run-as-Admin>Edit...>Parameters:


However I have been experimenting.. I don't think "%Z/N %X"%P" "%T" is the correct combination.
The above opens a new TC(admin) with only the active tab from the TC(original ). I would like the button to have ALL tabs from the TC(original), active and non-active.
I finally get notifications from emails again!!!
So happy!
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

Make an em_command like this:
1. Type cm_CommandBrowser in the TC command line <ENTER>
2. Go to: usercmd.ini - em_Run-as-Admin - click on "Edit..."
3. Command: *%COMMANDER_EXE%
4. Parameters: %Z/N %X"%P" "%T"
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK, OK
Em_command finished (it's about the same as if you were creating a button).

Make a button:
1. Right-click on an empty space on your buttonbar
2. Click on "change"
3. Click on "Add"
4. fill in the command: em_Run-as-Admin, cm_Exit
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK
Button finished.

Let me know if it fits now.
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

Hi Tuska,
tuska wrote:Make an em_command like this:
1. Type cm_CommandBrowser in the TC command line <ENTER>
2. Go to: usercmd.ini - em_Run-as-Admin - click on "Edit..."
3. Command: *%COMMANDER_EXE%
4. Parameters: %Z/N %X"%P" "%T"
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK, OK
Em_command finished (it's about the same as if you were creating a button).
Yep, I've done that.
tuska wrote:Make an em_command like this:
Make a button:
1. Right-click on an empty space on your buttonbar
2. Click on "change"
3. Click on "Add"
4. fill in the command: em_Run-as-Admin, cm_Exit
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK
Button finished.
Yep, I've done that too.
:D


it works.. almost.
in the TC(Original), when pressing the button, only the active tabs are shown in the TC(Admin). Ideally I would like all the tabs from the TC(Original) to show in the TC(Admin).

I think I need to change the Parameters: %Z/N %X"%P" "%T" but I am not sure what to change them to.

Thanks!
I finally get notifications from emails again!!!
So happy!
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

JimmyTheBroker wrote:Hi Tuska,
tuska wrote:Make an em_command like this:
1. Type cm_CommandBrowser in the TC command line <ENTER>
2. Go to: usercmd.ini - em_Run-as-Admin - click on "Edit..."
3. Command: *%COMMANDER_EXE%
4. Parameters: %Z/N %X"%P" "%T"
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK, OK
Em_command finished (it's about the same as if you were creating a button).
Yep, I've done that.
tuska wrote:Make an em_command like this:
Make a button:
1. Right-click on an empty space on your buttonbar
2. Click on "change"
3. Click on "Add"
4. fill in the command: em_Run-as-Admin, cm_Exit
5. Icon file: %COMMANDER_PATH%\Icons\CustomButton09.ico
6. Tooltip: ...
7. OK
Button finished.
Yep, I've done that too.
:D


it works.. almost.
When pressing the button, only the active tab of the TC(Original) are shown in the TC(Admin).
Ideally I would like all the tabs from the TC(Original) to show in the TC(Admin).

I think I need to change the Parameters: %Z/N %X"%P" "%T" but I am not sure what to change them to.

Thanks!
I finally get notifications from emails again!!!
So happy!
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

2JimmyTheBroker
Hmm, after clicking on the button I get a 1:1 copy of the current TC instance
-> with all active and inactive tabs in the new TC instance with admin rights.

The button has been quoted several times here in the forum - the problem will probably not be in the parameters to the button.
There must be something else (some setting in wincmd.ini?) - unfortunately I do not know why the button does not work for you.
Post Reply