Windows – Start Administrator Command Shell Window

Background

I find myself in a MS Windows Command Shell Window and will like to launch a new command shell window.

Because of what I need to do within the new command shell window, I need it to be an Administrator Command Shell.

 

Here are some ways to bring that about

Outline

  1. Powershell Start Command Shell Process and pass along verb Runas
    • Syntax
      • PowerShell -Command “Start-Process cmd -Verb RunAs”
      • PowerShell -Command “Start-Process -FilePath cmd.exe -Verb RunAs”

Powershell Command Start-Process / Parameter Verb Runas

Syntax

Syntax – Start Cmd Process


PowerShell -Command "Start-Process cmd -Verb RunAs"

Syntax – Start cmd.exe


powershell -Command "Start-Process -FilePath cmd.exe -Verb RunAs"


Output

Output – Image

Explanation

  1. When the command shell window is in Administrator mode, the title bar will read “Administrator C:\Windows\System32\cmd.exe

 

Diagnostic

You might want to know whether a process is running in elevated mode.

Outline

  1. Task Manager

 

Task Manager

  1. Add columns
    • The “Select Columns” appear
      • Please choose “Elevated

Images

Images – Columns

Images – Task Manager

Explanation

Processes that are running in the “Administrator Mode”, will have their Elevated Column set to Yes.

 

References

  1. Microsoft
    • Docs
      • Docs > PowerShell > Scripting > Reference > Microsoft.PowerShell.Management > Start-Process
        Link
  2. Stack Overflow
    • How to open an elevated cmd using command line for Windows?
      Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s