How to open an elevated cmd using command line for Windows?
I don't have enough reputation to add a comment to the top answer, but with the power of aliases you can get away with just typing the following:
powershell "start cmd -v runAs"
This is just a shorter version of user3018703 excellent solution:
powershell -Command "Start-Process cmd -Verb RunAs"
According to documentation, the Windows security model...
does not grant administrative privileges at all times. Even administrators run under standard privileges when they perform non-administrative tasks that do not require elevated privileges.
You have the Create this task with administrative privileges option in the Create new task dialog (Task Manager > File > Run new task), but there is no built-in way to effectively elevate privileges using the command line.
However, there are some third party tools (internally relying on Windows APIs) you can use to elevate privileges from the command line:
NirCmd:
- Download it and unzip it.
nircmdc elevate cmd
windosu:
- Install it:
npm install -g windosu
(requires node.js installed) sudo cmd