Do you use a replacment for notepad.exe, e.g. a multiple document editor?
I ask because error 31 is a DDE error (dynamic data exchange). It happens when the editor is already running in the background with normal user rights, and you try to launch it with other user rights, and the editor tries to activate its already running instance. This is prevented by Windows account control.
Windows Vista/7 elevation and cm_OpenAsUser
Moderators: white, Hacker, petermad, Stefan2
- ghisler(Author)
- Site Admin
- Posts: 48125
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
No, it's a pure Vista's notepad.exe.ghisler(Author) wrote:Do you use a replacment for notepad.exe, e.g. a multiple document editor?
The error 31 appears even when there is no notepad.exe instances already launched. If it matters I have UAC disabled on Vista.ghisler(Author) wrote:I ask because error 31 is a DDE error (dynamic data exchange). It happens when the editor is already running in the background with normal user rights, and you try to launch it with other user rights, and the editor tries to activate its already running instance. This is prevented by Windows account control.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
In the email Christian corrected the meaning of Error 31: it is SE_ERR_NOASSOC, which means: "There is no application associated with the given file-name extension."
Unfortunately this error 31 appears immediately after I press the button with 2 asterisks, so I can't even enter a username and password. (however that input dialogs with username and password requests appear for me if I use cm_OpenAsUser command.)Christian Ghisler wrote:It probably means that the target user account does not allow to run
EXE files. What type user account do you try to use for launching the
app? Can you login as that user to your system?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
- ghisler(Author)
- Site Admin
- Posts: 48125
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I have checked that now: Vista is missing the subkey "runasuser" below the key:
HKEY_CLASSES_ROOT\exefile\shell
I have tried to add it manually from what Windows 7 uses, but it doesn't work.
The only solution would be to change the command to:
runas /user:username c:\windows\notepad.exe
You will then just be asked for the password.
HKEY_CLASSES_ROOT\exefile\shell
I have tried to add it manually from what Windows 7 uses, but it doesn't work.
The only solution would be to change the command to:
runas /user:username c:\windows\notepad.exe
You will then just be asked for the password.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
According to information from this TechNet forum topic it seems that this Windows feature has been removed in Vista and added again in Windows 7ghisler(Author) wrote:I have checked that now: Vista is missing the subkey "runasuser" below the key:
HKEY_CLASSES_ROOT\exefile\shell
I have tried to add it manually from what Windows 7 uses, but it doesn't work.
It works, thanks. Since the asterisks are more universal (no need to write the username in the command field of the button), maybe you can consider for Vista to use for asterisks the same own username/password input dialogs as it currently uses for cm_OpenAsUser command instead of showing that Error 31?The only solution would be to change the command to:
runas /user:username c:\windows\notepad.exe
You will then just be asked for the password.
And on other issue that I have with cm_OpenAsUser: when it used on .exe with "As Administrator" property enabled and after entering a username and password nothing is started. I checked how the runas command will start such app. I copied notepad.exe to notepadadmin.exe, enabled the start as adminitrator file property for notepadadmin.exe and got this:
Code: Select all
>runas /user:Myusername notepadadmin.exe
Введите пароль для Myusername:
Попытка запуска notepadadmin.exe от имени пользователя "MYPCNAME\Myusername" ...
ОШИБКА RUNAS: Не удается запустить - notepadadmin.exe
740: Запрошенная операция требует повышения.
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 have exactly the same behavior also on Windows 7 32-bit. There are many discussions on the Web about runas error 740, but I couldn't fine one regarding the case described above, so I don't even know whether it's a by design runas limitation, or it's possible to change runas behavior for above case with some registry or policy tweak.DrShark wrote:... on other issue that I have with cm_OpenAsUser: when it used on .exe with "As Administrator" property enabled and after entering a username and password nothing is started. I checked how the runas command will start such app. I copied notepad.exe to notepadadmin.exe, enabled the start as adminitrator file property for notepadadmin.exe and got this:which says that elevation is required for this operation. It does show this error even form elevated cmd.exe!Code: Select all
>runas /user:Myusername notepadadmin.exe Введите пароль для Myusername: Попытка запуска notepadadmin.exe от имени пользователя "MYPCNAME\Myusername" ... ОШИБКА RUNAS: Не удается запустить - notepadadmin.exe 740: Запрошенная операция требует повышения.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708