Windows Vista/7 elevation and cm_OpenAsUser
Moderators: white, Hacker, petermad, Stefan2
Windows Vista/7 elevation and cm_OpenAsUser
Is there any way to start elevated app using cm_OpenAsUser? When I type login/password, program is opened w/o elevation. I tried to enter my account's login/password but no result.
- ghisler(Author)
- Site Admin
- Posts: 48231
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
No there isn't - I don't think that this is possible in one step. What you can do is write a small program or script which runs your program with verb "runas" - this causes the elevation.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I want to clear up some details on this command:
1) can cm_OpenAsUser execute programs or start associated files after entering login/password of user that marked as Administrator or member of Administartors group?
2) the same question for user that already logged in Windows?
3) does elevation of Total Commander itself matters for this command?
I tried to use cm_OpenAsUser from TC's command on different file types with my current administrator-level user's login and password on Vista 32 bit, and nothing happens.
1) can cm_OpenAsUser execute programs or start associated files after entering login/password of user that marked as Administrator or member of Administartors group?
2) the same question for user that already logged in Windows?
3) does elevation of Total Commander itself matters for this command?
I tried to use cm_OpenAsUser from TC's command on different file types with my current administrator-level user's login and password on Vista 32 bit, and nothing happens.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
2DrShark
cm_OpenAsUser is for programs under the cursor. If you want to start other file types, you can prefix the command with an asterisk (*); this can be done in a button and the TC start menu. Starting with TC9 you can also run as a different user (rather than elevated) by putting two asterisks in front of the command line. The latter is also useful when UAC is disabled.
Regards
Dalai
cm_OpenAsUser is for programs under the cursor. If you want to start other file types, you can prefix the command with an asterisk (*); this can be done in a button and the TC start menu. Starting with TC9 you can also run as a different user (rather than elevated) by putting two asterisks in front of the command line. The latter is also useful when UAC is disabled.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Yes there is are several ways:
Use Sudo from the totalcmd.net site or nircmd from NirSoft.
Or use the setting 'run as adminstrator'
But then the UAC prompt shows up.
Run without UAC prompt
Create elevated shortcut to skip UAC prompt in Windows 10
Or use: Winaero Tweaker
Search there for 'elevated shortcut'
Edit to comment MVV: Sorry, understood your topic wrong.
These are ways to start Totalcmd or any program elevated. Others can take this reaction just for information.
Use Sudo from the totalcmd.net site or nircmd from NirSoft.
Or use the setting 'run as adminstrator'
But then the UAC prompt shows up.
Run without UAC prompt
Create elevated shortcut to skip UAC prompt in Windows 10
Or use: Winaero Tweaker
Search there for 'elevated shortcut'
Edit to comment MVV: Sorry, understood your topic wrong.
These are ways to start Totalcmd or any program elevated. Others can take this reaction just for information.
Last edited by Cruysen on 2017-04-13, 09:49 UTC, edited 1 time in total.
To start a program that have enabled "As Administrator" option it the exe properties using cm_OpenAsUser, TC itself must be started as Administrator.Dalai wrote:cm_OpenAsUser is for programs under the cursor.
Just to make it clear: it seems that here the "command" word doesn't mean the cm_OpenAsUser command mentioned above, it's about the program name in the "Command:" field of the "Change single button" dialog.Dalai wrote:If you want to start other file types, you can prefix the command with an asterisk (*);
With 2 asterisks (**c:\Windows\notepad.exe or **%COMMANDER_EXE% as a command in a button) I get an error here on Vista 32 bit:Dalai wrote:Starting with TC9 you can also run as a different user (rather than elevated) by putting two asterisks in front of the command line. The latter is also useful when UAC is disabled.
Code: Select all
---------------------------
Total Commander
---------------------------
Error executing program! (31)
---------------------------
ОК
---------------------------
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
I don't think that elevation will be kept if you enter another user credentials...To start a program that have enabled "As Administrator" option it the exe properties using cm_OpenAsUser, TC itself must be started as Administrator.
Works fine for me under Windows 7x64.With 2 asterisks (**c:\Windows\notepad.exe or **%COMMANDER_EXE% as a command in a button) I get an error here on Vista 32 bit:
If Total Commander is not started as Administartor, after cm_OpenAsUser on .exe with "As Administrator" property enabled nothing is started (in this post my "nothing happens" words are about such case because that time all exe files I tried to start had "As Administrator" property enabled.)MVV wrote:I don't think that elevation will be kept if you enter another user credentials...DrShark wrote:To start a program that have enabled "As Administrator" option it the exe properties using cm_OpenAsUser, TC itself must be started as Administrator.
I just tried the following button:MVV wrote:Works fine for me under Windows 7x64.DrShark wrote:With 2 asterisks (**c:\Windows\notepad.exe or **%COMMANDER_EXE% as a command in a button) I get an error here on Vista 32 bit:
Code: Select all
TOTALCMD#BAR#DATA
**c:\windows\System32\cmd.exe
%COMSPEC%
0
-1
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
How To
On your site, MVV, the 'here' words are not links, and any other discussion appears absent.MVV wrote:...
...
Works fine for me under Windows 7x64.
I'd love to know how to use Sudo, but I'm not imaginative enough.
Any chance of instructions/discussion?
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Where is my site?
If you want to try my Sudo, please check my signature.
And using it is pretty easy - just append entire command line to it:
I usually put following su.bat file to Windows or System32 dir so I can start elevated command line in current directory by typing su into TC command line:
If you want to try my Sudo, please check my signature.
And using it is pretty easy - just append entire command line to it:
Code: Select all
cmd.exe /c echo Without Sudo & pause
Code: Select all
Sudo.exe cmd.exe /c echo With Sudo & pause
Code: Select all
@echo off
start "" "%SystemRoot%\System32\sudo.exe" "%SystemRoot%\System32\cmd.exe" /k "set prompt=$p# & cd /d "%cd%""
Last edited by MVV on 2017-05-24, 07:21 UTC, edited 2 times in total.
2ghisler(Author)
Do you have ideas why the command and the asterisks fail to launch programs in cases mentioned in this post? I asked you in email from June 8, 2017 about it, but so far I didn't receive a reply (btw I sent 3 emails to TC support email address on June 8, each on different topic, did you get them?)
Do you have ideas why the command and the asterisks fail to launch programs in cases mentioned in this post? I asked you in email from June 8, 2017 about it, but so far I didn't receive a reply (btw I sent 3 emails to TC support email address on June 8, each on different topic, did you get them?)
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708