Run PowerShell (and Command Prompt) Administratively

KB ID 0000988

Problem

We had the ‘run as’ service way back in Windows 2000, so the concept of running a command window ‘as administrator’ should not be difficult to understand. But the amount of times I tell people ‘You need to run that as administrator’, and they reply ‘I AM an administrator’ is far too high. With PowerShell theres no way of knowing, and with command prompt the differences are subtle.

Solution

There’s a myriad of different ways to launch an administrator command window, here are a few, If I’ve missed any let me know.

Launch Powershell in Administrative Mode 

Powershell administrative mode (from Within Powershell)

If you’re already in Powershell you can open an administrative Powershell window, with the following command;

Start-Process PowerShell -Verb RunAs

Switch PowerShell to Administrative Mode

Powershell Administrative Mode (from Start Menu)

Option 1: From Start/Search > Powershell > Right Click Windows PowerShell > Run as administrator.

Option 2: Start > Right Click Windows PowerShell > Run as administrator.

Launch Powershell Administratively option 2

Option 3: Start > Windows PowerShell > Windows Powershell > Run as Administrator.

Launch Powershell Administratively

Option 4: Right Click Start Menu (or Press Windows+X) > Window Powershell (Admin).

Launch Administrative Powershell

Powershell Administrative Mode (from Task Manager)

Launch Task Manger > File > Run new task > Powershell > Tick ‘Create this task with administrative privileges’.

Launch Administrative Powershell From Task Manager

Powershell Administrative Mode (from Windows Explorer)

From Windows Explorer > File > Open Windows PowerShell as administrator.

Launch Administrative PowerShell From Windows Explorer

Launch Command Prompt in Administrative Mode 

Administrator Command Prompt From Start Menu. (Windows 10 and Server 2016/2019)

From the Start/Search option > Type cmd > Then right click Command Prompt and select ‘Run as administrator’.

Server 2019 Run ad Administrator

Command Prompt (Admin) – Windows 10 (& Server 2016/2019) 

Right click the Start Button > Command Prompt (Admin)

2016 Admin command Window

Command Prompt (Admin) – Windows 8 (& Server 2012) Quick Links Menu

Press Windows Key+X > Select Command Prompt (Admin)

Quick links admin command

Administrator Command Prompt From Start Menu. (Windows 8 and Server 2012)

If you have the new Windows 8/2012 Start Menu (that we can’t call Metro any more) then type ‘command’ in the search window, then either right click and select ‘Run as administrator’, or press Ctrl+Shift+Enter to launch.

 admin command box

If you have the traditional start menu enabled or are running Windows 7/Vista, you can type command in the search/run box, then

admin command from start menu

Create An Always Run As Administrator Command Prompt Shortcut

1. Right click and empty area of your desktop > New > Shortcut.

Windows admin command prompt shortcut

2. Set the location to ‘cmd’ > Next > Call it Admin Command > Finish.

Windows admin command prompt shortcut

3. Right click your new shortcut > Properties.

Windows admin command prompt shortcut

4. Shortcut > Advanced > Run as administrator > Apply > OK.

Run shortcut As Administrator

 

Launch Admin Command Prompt from Task Manager.

Launch Task Manager (Ctrl+Shift+Esc) > File > Run new task > cmd > Tick ‘Create this task with administrative privileges’.

Launch Administrative Command From Task Manager

Launch Command Prompt ‘As Administrator’ From Command/Run.

I’m not a fan of this, in fact I only include it here for completeness, you can call a command windows and run it as administrator from command (or the run box (Windows Key+R). The reason I don’t like this is, you need to enter the machines local administrators password for it to work.

runas /user:%computername%administrator cmd

If theres any I’ve missed feel free to drop me an email, and I will update the article.

Related Articles, References, Credits, or External Links

NA

Author: Migrated

Share This Post On