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

笑着哭i 提交于 2019-12-03 12:15:47

问题


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.


回答1:


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)":

[

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

[




回答2:


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.




回答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.


(source: winaero.com)



来源:https://stackoverflow.com/questions/32341507/how-open-powershell-as-administrator-from-the-run-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!