Start a associated program als Admin.

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
jslegers
Member
Member
Posts: 129
Joined: 2003-07-17, 08:13 UTC

Start a associated program als Admin.

Post by *jslegers »

Hello,

I have the following in my wincmd.ini file :

[Extensions]
bmp=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.bmp
gif=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.gif
jpg=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.jpg
jpeg=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.jpeg
png=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.png
tif=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.tif
tiff=%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.tiff

I want to start Imagine as admin so that it will use the ini file in the program directory.

So I changed it to this :

[Extensions]
bmp=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.bmp
gif=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.gif
jpg=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.jpg
jpeg=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.jpeg
png=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.png
tif=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.tif
tiff=*%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.tiff

But that doesn't work.

Is it even possible to start a associated program as Admin ?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Start a associated program als Admin.

Post by *ghisler(Author) »

The * does nothing here, it's only for the button bar and TC start menu.

You could try with a tool like "elevate" - it's open source:
http://code.kliu.org/misc/elevate/
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Start a associated program als Admin.

Post by *MVV »

You can also use my Sudo tool, it accepts target command line as is, without any modification:

Code: Select all

%COMMANDER_PATH%\Sudo.exe %COMMANDER_PATH%\Tools\Imagine\Imagine64.exe ^.bmp
But if you need to start many programs as admin, it may be easier to open elevated TC session.

Also, you can just start Imagine via a buttonbar button or a hotkey+user command, in such case you don't need to create a bunch of associations, it will take any file type:

Code: Select all

Command: *%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe
Parameters: %P%N
As for me, I use F4Menu tool for the ability of editing different files by single F4 key, and I've added some extra tools to its menu, one of them just starts F4Menu as admin, so I can use any editor as admin when I need, and it is very handy.

Finally, you can add a context menu item for opening image file types in elevated Imagine using Internal associations. Just add an action and select it from context menu:

Code: Select all

Action: Imagine (sudo)
Command: "%COMMANDER_PATH%\Sudo.exe" "%COMMANDER_PATH%\Tools\Imagine\Imagine64.exe" "%1"
Please note that it may be not too convenient if you already have internal associations that partially match these file types because unforunately TC still can't merge context menus for file types appearing in different internal association entries so you may have to add this item to multiple entries.
User avatar
jslegers
Member
Member
Posts: 129
Joined: 2003-07-17, 08:13 UTC

Re: Start a associated program als Admin.

Post by *jslegers »

Thanks for the replies. I will use the sudo tool.
User avatar
jslegers
Member
Member
Posts: 129
Joined: 2003-07-17, 08:13 UTC

Re: Start a associated program als Admin.

Post by *jslegers »

ghisler(Author) wrote: 2018-12-17, 14:40 UTC The * does nothing here, it's only for the button bar and TC start menu.

You could try with a tool like "elevate" - it's open source:
http://code.kliu.org/misc/elevate/
Thank you for the answer.

Are there any plans that * is going to be implemented for the associations ?
Post Reply