Optional run as administrator in button bar

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2MVV,

I couldn't get it to run in XP. TC wanted to close it for some reason. Not that I need it but I like to play. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Boofo wrote:2MVV,

I couldn't get it to run in XP. TC wanted to close it for some reason. Not that I need it but I like to play. ;)
That's strange, on my work PC with XP SP2 it works fine, also it works for me in Vista/7 w/o any troubles. When I start it w/o params, nothing happens, when I pass command line, OS shows RunAs/Elevate dialog.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

What parameters are you using? I just tried it alone. The help file is kind of sparse. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Boofo wrote:What parameters are you using? I just tried it alone. The help file is kind of sparse. ;)
Just pass a command line that you wanna to execute as admin:) hlp file may have greater size than tool=) i.e. I have some buttons for launching some apps elevated:

Code: Select all

button3=E:\TOTALCMD\TOTALCMD.exe
cmd3=E:\TOTALCMD\Sudo.exe
param3=""E:\TOTALCMD\TOTALCMD.exe" /N %X"%P" "%T""
menu3=Admin: Total Commander

cmd5=E:\TOTALCMD\Sudo.exe
param5=""E:\Program Files\Tools\Notepad\Notepad++.exe" %P%N"
menu5=Admin: Edit
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2MVV

I have TC set to only allow 1 copy at a time. How does it open a second copy of TC as Admin?
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Sombra
Power Member
Power Member
Posts: 811
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

How does it open a second copy of TC as Admin?
Hello boofo,
Parameter /N launch a new session of TC even if you have checked "allow only one copy"
I can read English, but... I write like Tarzan. (sorry)
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2Sombra,

N=New. Duh on me. Thanks for the explanation. ;)

I tried to figure out a way to close TC and then re-open it as Admin, but I couldn't get anything figured out. This will work, though.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2MVV,

What kind of instance would you need to run a text editor in Admin mode? I'm curious now. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
j
Member
Member
Posts: 124
Joined: 2009-04-13, 19:49 UTC

Post by *j »

Edit global settings like [face=courier]hosts[/face] would be a use case for an elevated editor.

Other than that, here is what I do:
I created a NTFS link [face=courier]TOTALCMD_ADMIN.EXE[/face] to [face=courier]TOTALCMD.EXE[/face] and set its properties to "Run this program as Administrator" - under Windows 7 this has the nice advantage that the "Admin TC" gets an extra slot in the taskbar and a little "shield" as overlay.

On top of that, in the wincmd.ini, I have

Code: Select all

[Colors]
RedirectSection=colors_%__COMPAT_LAYER%.ini
Thus getting [face=courier]colors_RunAsAdmin.ini[/face] and [face=courier]colors_ElevateCreateProcess.ini[/face] to get a extra color theme for the elevated instance (I changed the background color slightly).

I suppose this should work under Vista too.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2j,

I use XP Pro SP3 so I don't think that would apply to me, unless you know how it would be done in XP.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Boofo wrote:2MVV,

What kind of instance would you need to run a text editor in Admin mode? I'm curious now. ;)
Sorry, maybe I hadn't understood it right, but if you ask the reason to launch text editor as admin, I'll answer:

Sometimes when I edit user-write-protected file (in Vista/7 this is normal for program files dir etc.) and press Save, editor says that save failed (even notepad.exe)...
So, I need to edit file in elevated editor (I just trying to use elevated TC only when it really needed, i.e. for sync user-write-protected folders).
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2MVV,

Ahh, OK, that makes a little more sense to me now. So, how do you know that you are in the program as Admin? In TC that shows up in the top line, but in EditPlus, I didn't see any confirmation on it anywhere.

And thank you for explaining that, sir. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Boofo wrote:2MVV,

Ahh, OK, that makes a little more sense to me now. So, how do you know that you are in the program as Admin? In TC that shows up in the top line, but in EditPlus, I didn't see any confirmation on it anywhere.

And thank you for explaining that, sir. ;)
I can't understand which text editor has admin rights:) just need to remember. BTW, sometimes it is very funny to start editor elevated when it looks for another instance (non-elevated usually) and passes filename to it, so my elevated launch has no effect. :lol:

BTW, in Process Explorer I can determine this fact - easiest way is to look Sudo.exe as parent:) but also elevated process has longer privileges list.

Of course, if it is necessary to determine, a good way is to have two configurations which differ in colors or something else.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2MVV,

The different colors configuration is a good idea. ;)

Is there any way to have Sudo.exe automatically pick the admin login (like runas does), maybe with a parameter?
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

@MVV Interesting TINY program. Appears to work under Win2K. I'll have to login under a user w/o Admin rights to check for sure.

Which makes that 1.8MB "explorer shim" program noted on page 1 seem all the more ludicrous. Before it was only 200 times bigger than "runas.exe", but now it's 900 times bigger than MVV's sudo hehehe.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Post Reply