Runas command and other run as administrator options on Windows 10

Run an application with elevated rights as administrator on an UAC System and
run an application with administrator rights from a normal standard user account are
two different problems.
Find explanation, solutions and examples for both problems and a better understanding on this page.


Run an application with elevated rights as administrator on an active UAC system

What are elevated privileges?

How can i request elevated privileges?

How can i get elevated privileges and bypass the UAC?


Run an application with administrator rights from a normal standard user account

Why do i need to run an application as administrator from a limited account?

How can i run an application as administrator from standard user account?

  1. Command runas from Microsoft
    >> runas /user:admin c:\windows\system32\cmd.exe <<
    Runas command
    Next step you will be asked for password of the administrator account
    Runas password

  2. Command runasspc including password argument
    >> runasspc /user:"admin" /password:"pass" /program:"c:\windows\system32\cmd.exe" << RunAsSpc command
    Runasspc can also hide the password in an encrypted file.
    RunAsSpc command crypt file
    You find RunAsSpc on https://robotronic.de/runasspcen.html

  3. Runasrob, the most effective tool with different possibilities for any purpose.
    Grant the allowed directory in the graphical user interface RunAsAdmin, a part of RunAsRob, then you can call this allowed application by command via runasrob.exe
    >> "C:\Program Files\RunAsRob\runasrob.exe" "C:\Windows\System32\cmd.exe" <<
    RunAsRob command
    RunAsRob can call the allowed application with system account and bypass the UAC Dialog
    or as administrator with full profile of the calling user, because he will be an administrator with his own account, only for the authorized application.
    It is not necessary to store administrator credentials anywhere.
    You can authorize one or more applications, you can use wildcard in the path name and you can grant folders. Read more about RunAsRob on https://runasrob.com

  4. Other tools. Please take a look on https://runas.eu


Examples to run an application as administrator from standard user


Packages of Ninite Installer can install by a limited user without to know the administrator credentials

1) with RunAsRob the part RunAsAdmin
RunAsRob Ninite

2) or RunAsSpc with administrator login information of administrator in plain text
RunAsRob Ninite

3) or RunAsSpc with encrypted file and hidden paassword.
RunAsSpc Ninite


Run Powershell script as administrator

First of all, enable powershell script on machine.

Now there are various ways.

1) Run script as administrator from admin account with elevated privileges.

  1. Self elevate powershell script is working, by call the same script with elevated privileges inside the script. I am against doing this, because it is the risk to get an endless loop
  2. or elevate the powershell script by calling the script via another powershell start script, which elevate the main script.
    >> Start-Process powershell.exe -ArgumentList '-file c:\test\powershell\pscript.ps1' -Verb RunAs <<
  3. or create a shortcut to your Powershell script with command PowerShell.exe -Command "& 'C:\Temp\script.ps1'"
    and set in the shortut property tab -> Advanced -> Run as administrator
    Run Powershell script as administrator

2) Run script as administrator from standard user account.

  1. Create a shortcut to your Powershell script with command PowerShell.exe -Command "& 'C:\Temp\script.ps1'"
    and set in the shortut property tab -> Advanced -> Run as administrator
    After start of shortcut, you will be asked to enter administrator credentials.
  2. An elegant way to run Powershell script as administrator from standard user and avoid entering the credentials and bypass the UAC is using RunAsAdmin from RunAsRob. You just have to authorize the script in RunAsAdmin and launch it via RunAsRob.
    See following example configuration with a Powershell script >> c:\scrpt.ps1 <<
    1. Authorize the complete call in RunAsAdmin >> C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\scrpt.ps1 <<
    2. with login option >> as system <<
    3. Now you can call scrpt.ps1 via RunAsRob and it is running with system rights under standard user account.
      >> "C:\Program Files\RunasRob\RunAsRob.exe" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\scrpt.ps1" <<
    Run Powershell script as administrator from user

Run cmd as administrator to get the command line with elevated privileges

Run command line with elevated privileges from administrator account.

Run command line with elevated privileges from user account.


Run batch file as administrator

Launch a batch file with elevated privileges from an administrator account.

Create a shortcut of the batch file, select in properties of the shortcut -> advanced -> run as administrator.

Start a batch file as administrator from a user account.

Choose the easiest way and use RunAsRob https://runasrob.com

  1. Allow the directory of the batch file in RunAsAdmin, a part of RunAsRob
  2. Start your batch file with command >> "C:\Program Files\RunasRob\RunAsRob.exe" "C:\test\batch01.cmd" <<
  3. Call this command directly, in a batch file, any script or in a shortcut
Run batch file as administrator from user

Links to other Runas explanations, solutions and examples


Date: 2021-09-03
2021-09-03 Oliver Hessing