Optional run as administrator in button bar

Here you can propose new features, make suggestions etc.

Moderators: Stefan2, white, sheep, Hacker

User avatar
Sombra
Power Member
Power Member
Posts: 795
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Optional run as administrator in button bar

Post by *Sombra » 2008-02-24, 12:16 UTC

The next text is referred to programs in "button bar": Sometimes is useful launch an application as administrator, if TC is opened as normal user I can do it in several ways:
- Close TC an restart as administrator.
- Right click in button bar and choose cd <path> then in the application directory call to the internal command of tc for open as a different user or right click and choose Run as... | Run as administrator.

In my opinion all these ways are a bit longs. A method for save the wasted time could be add a new option in menu shown with right click in the toolbar, like the text in red:
  • Program Name/tooltip
    Run as administrator
    ----
    Change...
    Delete...
    cd <path>
    ---
    Cut
    Copy
Another way and less flexible, could be add a new checkbox in the window configuration of the toolbar under the options:
  • [ ] Run minimized
    [ ] Run maximixed
    [x] Run as administrator
I can read English, but... I write like Tarzan. (sorry)

User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 » 2008-02-24, 12:23 UTC

Google says that this should help.

User avatar
HolgerK
Power Member
Power Member
Posts: 5075
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK » 2008-02-24, 14:07 UTC

m^2 wrote:Google says that this should help.
Reading the FAQ "...RAA replaces the original windows shell...", I doubt that I would give it a try.
m^2 signature wrote:Vista wrote:

Code: Select all

Wait...
It's the consistent evolution of the here mentioned Top Secret Microsoft Code :D

Kind regards,
Holger

User avatar
HolgerK
Power Member
Power Member
Posts: 5075
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Optional run as administrator in button bar

Post by *HolgerK » 2008-02-24, 14:16 UTC

Sombra wrote:...a new option in menu shown with right click in the toolbar, like the text in red:
  • Program Name/tooltip
    Run as administrator
    ----
    Change...
    Delete...
    cd <path>
    ---
    Cut
    Copy
Another way and less flexible, could be add a new checkbox in the window configuration of the toolbar under the options:
  • [ ] Run minimized
    [ ] Run maximixed
    [x] Run as administrator
Support++

For ".exe" or ".bat" files, I can use the file context menu with "run as admin"
This doesn't work for e.g. ".vbs".

Accessing this possibility in Buttons, Menus and User commands would help a lot.

Kind regards,
Holger

User avatar
Sombra
Power Member
Power Member
Posts: 795
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra » 2008-02-24, 16:25 UTC

Hi,
Google says that this should help.
Perhaps for a local use, but not as a portable solution. Anyway, as HolgerK wrote this tool replace the windows shell, I don't like that idea much. :?
Accessing this possibility in Buttons, Menus and User commands would help a lot.
I didn't thought in the extended commands, that is a good idea, too.
Vista wrote:
Wait...
:mrgreen:[mode joke /on]
- Wait... What? start the O.S., perform operations, the technical service... ¿? look to the man/woman at 01:53 :lol: :lol:
:mrgreen:[mode joke /off]
I can read English, but... I write like Tarzan. (sorry)

User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 » 2008-02-24, 16:45 UTC

Maybe this one is better?

User avatar
Sombra
Power Member
Power Member
Posts: 795
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra » 2008-02-24, 17:47 UTC

2m^2
Thank you for search info about it :), I don't understand exactly the script, it launch only the console in administrator mode, or I am missing anything, I guess.

I'm investigating a bit about sudowin and Start ++
The second, start++ seen work fine when I call to an program with sudo my_program.exe, meanwhile it could be a possible solution . Of course, not portable and only under windows vista.
Now I have a button done with TCMenu for show the menu with two entries: Normal and run as administrator.

Anyway, I hope that Christian Gisler thinks about this suggestion.
I can read English, but... I write like Tarzan. (sorry)

EJocys
Junior Member
Junior Member
Posts: 3
Joined: 2009-08-20, 10:54 UTC

SHIFT+CTRL - run as administrator

Post by *EJocys » 2009-08-20, 23:05 UTC

IF user holds down SHIFT+CTRL then TC will run bar apps as administrator, just like Windows does with Start Menu. So we can have one icon on BAR for two different modes.

-------------------------------------------------------

Here is a free tip for MS-DOS batch users. As you know windows have 'runas' command which always asks for administrator password or doesn't work at all if password is not set. If you want batch file to elevate itself to administrative privileges through Windows GUI (no password required) then just put this at the top of your MS-DOS batch file:

@echo off
::-------------------------------------------------------------
:: Check permisions and run as Administrator.
::-------------------------------------------------------------
ATTRIB %windir%\system32 -h | FINDSTR /I "denied" >nul
IF NOT ERRORLEVEL 1 GOTO:ADM
GOTO:EXE
:ADM
:: Create temp batch.
echo @echo off> %~n0.tmp.bat
echo %~d0>> %~n0.tmp.bat
echo cd "%~p0">> %~n0.tmp.bat
echo call "%~nx0" %1 %2 %3 %4 %5 %6 %7 %8 %9>> %~n0.tmp.bat
echo del %~n0.tmp.bat>> %~n0.tmp.bat
:: Create temp script.
echo var arg = WScript.Arguments;> %~n0.tmp.js
echo var wsh = WScript.CreateObject("WScript.Shell");>> %~n0.tmp.js
echo var sha = WScript.CreateObject("Shell.Application");>> %~n0.tmp.js
echo sha.ShellExecute(arg(0), "", wsh.CurrentDirectory, "runas", 1);>> %~n0.tmp.js
:: Execute as Administrator.
cscript /B /NoLogo "%~n0.tmp.js" "%~dp0%~n0.tmp.bat"
del %~n0.tmp.js
GOTO:EOF
:EXE

::-------------------------------------------------------------
:: Main
::-------------------------------------------------------------

:: At this point administrative rights to this batch will be granted.
:: execute commands with administrative privileges here.
Last edited by EJocys on 2009-08-20, 23:30 UTC, edited 1 time in total.

User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom » 2009-08-20, 23:19 UTC

@m^2
What is the point of that sourceforge program? (1.8MB for an "explorer shim" !?!)
Did vista/win7 get rid of "runas.exe" ??

under Win2K:
runas /env /user:administrator notepad
If it Vista did get rid of it, then I wonder if Win2K's or WinXP's RunAs.exe would work?

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 » 2009-08-21, 00:03 UTC

2Balderstrom,

The following works perfectly on XP Pro SP3.

Code: Select all

runas /env /user:administrator "C:\Program Files\totalcmd\TOTALCMD.EXE"
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 » 2009-08-21, 00:47 UTC

@ Boofo, hehe, yeah and its a whopping 9KB's ;)
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.

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 » 2009-08-21, 00:51 UTC

Balderstrom wrote:@ Boofo, hehe, yeah and its a whopping 9KB's ;)
In what way?
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: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-08-21, 04:06 UTC

m^2 wrote:Maybe this one is better?
O_o I think script author drunk very much before:)
Boofo wrote:

Code: Select all

runas /env /user:administrator "C:\Program Files\totalcmd\TOTALCMD.EXE"
This in Vista always asks an admin password.

In Vista there is an additional action verb "runas" for ShellExecute function. So, it is very simple to use it for elevating new application.

Here is my very little tool that I use to run elevated apps:

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="Sudo.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Sudo.zip"

UEsDBBQAAgAIAHpnCTvmLmh5SAIAAAAIAAAIAAAAU3Vkby5leGXtVM9r01Ac/6Ytms22y6AFDxXf
Sg6eiqiHqjsU1miZ0dV2UPRk1r6sKWki6Qv0JEKYMMakl148efBPUDd76kGcirv4B4gHDwqC4kX0
El/y0nQTcfPgZewDXz7fX+/zvo+Xl6s3exAFgBg11wXYBIYC7I0hteTJQRIeT2zPbHLy9sxiU+ug
25a5bCltVFcMwyRoCSPLNpBmoOJCFbXNBs4lEpNioHFDvPfihPSxP7J380/6x33/k88XnAf9jM89
nytaven1jWYoSwAyF4GjvTvzo9x7iHLHOB4gAsw8CIGh4HQCq8WC8ojh9DhgZYH1hhySj1NUbxb+
A6hu5i/lHMFdQjnPQXiW8SFCiVs5q6EQBeBrkPD7juzuK+zvug9xAOF8nnXTgAqgOvnswPtAbN4Z
RgZZ6k1t8OrKKzKtXnxN4lMbpQgt0IT9RXV+Zm1ePS/YUS/l5JEtrD/yn3QQk+9ssc23ODcd9/V/
/K5PG2HtJUlSITLBFoL9zRdPeOK8uhUqAtkZ/WG/1aKYWo+J5a2iGPMeJGW+wDgOjIUMnWNVFlPU
zwQ55L0fN52ilZUhnTbCpl2TxXzLve6mY16wKOYrbpqnbgtY/c1Buf/79EoeUntK7S5iubcBW2CD
AQp0qN9A4zXPEfuXdHfkPlA/hf59j2cgdTVStsw67nRgmruMyZzZbitGQ9YMXINetKZo5JJpVTVj
WccLSy1cJ3AO5nSzg0u0TcdwRapck+SzZ3INXQeY5KpNrOtSF9dtgqVuDaolSQ7Lh9iFX1BLAQIU
ABQAAgAIAHpnCTvmLmh5SAIAAAAIAAAIAAAAAAAAAAAAIAAAAAAAAABTdWRvLmV4ZVBLBQYAAAAA
AQABADYAAABuAgAAAAA=
Last edited by MVV on 2009-08-21, 04:40 UTC, edited 1 time in total.

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 » 2009-08-21, 04:17 UTC

2MVV,

I take it this won't run 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: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-08-21, 04:30 UTC

Boofo wrote:2MVV,

I take it this won't run in XP?
Hmm... AFAIK, in WinXP there is no elevation mode, so I think this just won't.... I tested this now in WinXP and OS shows GUI "Run As" dialog as if you select "Run As" from context menu, so all ok!

In Vista/7 user just needs to answer Yes, in XP user needs to select user and enter a password also.

Post Reply