10

Until now I used shortcut with "runas/user:ComputerName\Administrator /savecred "C:\Program Files (x86)\example.exe"

when I type a command in the cmd error 740 occurs:

C:\>"C:\Users\user\Favorites\Linki\runas.exe.lnk"
Attempting to start C:\Program Files (x86)\example.exe as user "ComputerName\Administrator" ...
RUNAS ERROR: Unable to run - C:\Program Files (x86)\example.exe
740: The requested operation requires elevation.

Does anyone know if this is an error or a deliberate action, and how I can achieve this functionality now?

Regards

5
  • 2
    Is your command prompt in admin/elevated mode?
    – techturtle
    Sep 30, 2016 at 14:33
  • @techturtle Yes it is. But shortcut is lunched from standard user and admin cred has to be typed once. /savecred should save it
    – dudinr1
    Sep 30, 2016 at 15:21
  • FYI for people coming more recently - I just got bitten by this on a machine, now running Windows 10 version 1803 (as installed on 2018-06-18). Solutions below worked.
    – wally
    Jun 24, 2018 at 11:25
  • Is there a reason you cant simply "right-click, run as admin"? Do you really need to run these apps under the actual Administrator user? Jun 24, 2018 at 14:29
  • To clarrify, the reason I ask is that the windows Administrator user account is "special" in several ways. Among them being the MS has been trying to phase its use out and will probably remove it from Windows entirely one day. Even if you normally use a basic user account that cant elevates its own privileges, it's still better to create a dedicated administrative user and elevate to that... which also still works with "right click, run as admin" without necessitating batch files and runas shortcuts. Jun 24, 2018 at 14:56

5 Answers 5

5

I somehow managed to solve the issue by first running the command prompt as administrator using

runas /profile /savecred /user:administrator "cmd.exe" 

put another batch file in \windows\system32 folder to run the exe. and just type the name of that batch file.

5

This is what worked for me

start cmd first then use it to start your other app

runas /profile /user:ExlordPC\Exlord /savecred "cmd.exe /k C:\Users\Exlord\AppData\Local\NextVPN\NextVPN.exe"

2
  • 1
    Can confirm, this works.
    – JIV
    Mar 11, 2020 at 8:10
  • For me, this just opened a new command window.
    – johny why
    Dec 9, 2023 at 20:53
3

I just got bitten by this on a machine, now running Windows 10 version 1803 (as installed on 2018-06-18).

The solution (combined with the other answers here) for me was discovery (and reversion) of a change to my local PC's GPO.

  • In the GPO snapin for mmc.exe
  • Navigating to: Local Computer Policy / Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options
  • There's a setting called
    "User Account Control: Admin Approval Mode for the Built-in Administrator account"

Reverting that to what it calls the "Default" mode of disabled resolved the issue.

Possibly using an administrator account other than the built-in default might have worked too (untested).

1
  • I too found the local policy change is the way to fix this issue. Mar 11, 2020 at 3:06
2
runas /savecred /user:YourDomain\YourUser "cmd /c start /b mmc dsa.msc"
3
  • Could you provide some context for this answer?
    – Burgi
    Jan 22, 2020 at 9:51
  • 1
    @Burgi I don't know what you mean by context, but this did the trick for me, mainly the part around CMD "/c start /b". I'm on Windows 10 Enterprise 1803, under an AD Domain.
    – Gaston
    Feb 4, 2020 at 2:48
  • It first invokes a command prompt running in the context of another user with runas, then uses that to invoke the "START" command (another command prompt), further invoking the Microsoft Management Console specifically loading the DSA.MSC component. CMD /C: "Carries out the command specified by string and then terminates"; START /B: "Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application." Aug 12, 2022 at 15:39
-1

I found a solution create a batch file and put the following command in that runas /profile /savecred /user:administrator "cmd.exe /C

eg. runas /profile /savecred /user:administrator "cmd.exe /C D:\190914\SmartDB\smartdb.exe"

Save the batch file and run it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .