Windows 8 and 8.1 - Run as Administrator

Steven HarrisCST Manager
Published:
From time to time users may run across the need to run a program or script as an administrator.  In Windows 8 and 8.1, there are a few different ways of running these types of actions.

From the Start Screen or Apps Screen
From the start screen you are able to run a program as an administrator through two methods.  First, navigate to your program and either right-click the icon or long-press the icon (for touch users).  This will enable the app bar where you have the Run as administrator option.

app bar
For users who are fans of shortcut keys, you can use the 'Ctrl+Shift+Click" method.  While holding down both the Ctrl and Shift keys, click on the program that you wish to run as administrator.

From the Desktop
From the desktop Screen you are able to invoke the run as administrator option through context menu.  First, you will right-click or long-press (for touch users) to bring up the context menu.  From the context menu, select the run as administrator option, notated by the blue and yellow shield icon, the User Account Control (UAC) icon.

desktop
From the Taskbar
From the taskbar you are able to use the run as administrator option through two methods.  First, right-click on a program to enable the jump list.  Once the jump list is in view, right-click on the program in the jump list menu to bring up the context menu. From the context menu, select the run as administrator option, notated by the blue and yellow shield icon, the User Account Control (UAC) icon.

For users who are fans of shortcut keys, you can use the 'Ctrl+Shift+Click" method.  While holding down both the Ctrl and Shift keys, click on the program in the taskbar that you wish to run as administrator.

taskbar
Run as Administrator Shortcut
If you are running a program frequently that requires the run as administrator permission, it may be beneficial to just set the shortcut to always run as administrator.

From the Taskbar
From the taskbar, right-click on a program to enable the jump list.  Once the jump list is in view, right-click on the program in the jump list menu to bring up the context menu. From the context menu, select the Properties option.  In the program's properties window, navigate to the Shortcut tab, then click advanced.

program properties
From the advanced menu, select the Run as administrator option and click OK.

advanced properties
From the Desktop
From the desktop Screen right-click or long-press (for touch users) to bring up the context menu.  From the context menu, select the Properties option.  In the program's properties window, navigate to the Shortcut tab, then click advanced.

program properties
From the advanced menu, select the Run as administrator option and click OK.

advanced properties
Advanced Run as Administrator Tools
For users who are comfortable behind the console, there are a few ways to elevate programs using commands.

Command Prompt
runas /profile /user:<username> “C:\programs\<program>.exe”

Open in new window


PowerShell
start-process -verb RunAs <program>

Open in new window


Elevate PowerShell from a Script, before running the Script
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
                      
                      {   
                      $arguments = "& '" + $myinvocation.mycommand.definition + "'"
                      Start-Process powershell -Verb runAs -ArgumentList $arguments
                      Break
                      }

Open in new window

2
8,391 Views

Comments (1)

CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Allow the comments: you show no elevation on the command line. runas has nothing to do with elevation - it would only elevate if the built-in administrator account would be used. For command line elevation, elevate the command prompt itself OR rightclick the script ->"run as administrator", or use elevate: http://technet.microsoft.com/en-us/magazine/2007.06.utilityspotlight.aspx (still the same for win 8.1).
Also you should include the task scheduler as another way of elevating code interactively.

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.