Monday, 1 October 2018

Opening an Elevated Command Prompt (Windows Server)

There are many instances when you want to open an elevated (admin) command prompt in Windows Server.  Normally this is really easy: right-click on the icon and select "Run as administrator".

But what do you do when you can't right-click, you are running in "core" mode, or the GUI isn't running properly?  Well, PowerShell to the rescue...

If you can open PowerShell, type:
       Start-Process cmd -Verb RunAs

If you can't, but can open a (none-admin) command prompt, type:
       Powershell -Command "Start-Process cmd -Verb RunAs"

You may get a UAC prompt, but essentially this will open an elevated command prompt.

Note:  This has been tested in Windows Server 2008, 2012 and 2016.

No comments:

Post a Comment