Command Prompt and PowerShell can be run with admin rights, and with normal user rights. It goes without saying that if you run either of these command lines with admin rights, you can execute higher-level commands. With normal user rights, the commands that you can execute in either Command Prompt or PowerShell are tame. In many cases, you might even be blocked from running scripts. If you often need to open either or both these apps with admin rights and would like to skip using the context menu to do it, you can have Command Prompt and PowerShell always run as admin.
This trick will work for a specific shortcut to Command Prompt and PowerShell. You must always use that shortcut to open these apps. Any other shortcut that you use or any other method that you use to open them will not result in them opening with admin rights. While, in theory, you can change this behavior for any and all instances of Command Prompt and PowerShell, it isn’t a good idea to do so since it will involve taking ownership of the EXEs for both apps, and that may lead to additional problems down the line.
To keep it simple, either pin Command Prompt and/or PowerShell to the Start Menu or, pin them to the taskbar.
Run Command Prompt as Admin
If you’ve pinned Command Prompt to the Start menu, right-click the tile and go to More>Open File Location. Right-click the Command Prompt shortcut that opens in a new folder. If you have a simple desktop shortcut, you can just right-click it provided you will always be using that shortcut to open Command Prompt.
Go to the Shortcut tab, and click Advanced. Select the ‘Run as administrator’ option, and click OK. Now, the next time you use this shortcut or tile to open Command Prompt, it will open with admin rights. You will still see the UAC prompt.
Run PowerShell as Admin
To always open PowerShell as admin, you will use more or less the same method that you did for Command Prompt. Locate the shortcut that you want to use to open PowerShell. Right-click it and select Properties from the context menu. Go to the Shortcut tab and click the Advanced button. Select the ‘Run as administrator’ option, and click OK, and then Apply. That’s all you need to do. Every time you use that same shortcut to open PowerShell, it will open with admin rights. You will still get the UAC prompt before the app actually opens.