Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How open PowerShell as administrator from the run window [closed]

Tags:

Is possible open a new PowerShell console as administrator through the run window, in Windows?

I know that just typing 'powershell' in the run window is enough to start a new console, but is there a parameter to start it 'as Administrator'?

Like:

"powershell /runas:Administrator"

or something?

PS: I'm using Windows 10 -- I don't know if makes any difference.

like image 744
mukade Avatar asked Sep 01 '15 21:09

mukade


2 Answers

The easiest way to open an admin Powershell window in Windows 10 (and Windows 8) is to add a "Windows Powershell (Admin)" option to the "Power User Menu". Once this is done, you can open an admin powershell window via Win+X,A or by right-clicking on the start button and selecting "Windows Powershell (Admin)":

[Windows 10/Windows 8 Power User menu with "Windows Powershell (Admin)

Here's where you replace the "Command Prompt" option with a "Windows Powershell" option:

[Taskbar and Start Menu Properties: "Replace Command Prompt With Windows Powershell"

like image 104
Simon MᶜKenzie Avatar answered Sep 22 '22 21:09

Simon MᶜKenzie


Yes, it is possible to run PowerShell through the run window. However, it would be burdensome and you will need to enter in the password for computer. This is similar to how you will need to set up when you run cmd:

runas /user:(ComputerName)\(local admin) powershell.exe

So a basic example would be:

runas /user:MyLaptop\[email protected]  powershell.exe

You can find more information on this subject in Runas.

However, you could also do one more thing :

  • 1: `Windows+R`
  • 2: type: `powershell`
  • 3: type: `Start-Process powershell -verb runAs`

then your system will execute the elevated powershell.

like image 25
Matt Wilkinson Avatar answered Sep 22 '22 21:09

Matt Wilkinson