How open PowerShell as administrator from the run window

时间:2015-09-01 21:55:04

标签: windows powershell windows-10

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.

3 个答案:

答案 0 :(得分:29)

在Windows 10(和Windows 8)中打开管理员Powershell窗口的最简单方法是在“高级用户菜单”中添加“Windows Powershell(Admin)”选项。完成后,您可以通过 Win + X A 或右键单击开始按钮并选择打开admin powershell窗口“Windows Powershell(Admin)”:

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

您可以在此处使用“Windows Powershell”选项替换“命令提示符”选项:

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

答案 1 :(得分:12)

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\AMicrosoftAccount@outlook.com  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.

答案 2 :(得分:3)

Windows 10 appears to have a keyboard shortcut. According to How to open elevated command prompt in Windows 10 you can press ctrl + shift + enter from the search or start menu after typing cmd for the search term.

image of win 10 start menu http://winaero.com/blog/wp-content/uploads/2014/10/Start-menu-elevated-600x492.png