How to open an elevated cmd using command line for Windows?

user2633882 picture user2633882 · Sep 30, 2013 · Viewed 326.8k times · Source

How do I open a elevated command prompt using command lines on a normal cmd?

For example, I use runas /username:admin cmd but the cmd that was opened does not seem to be elevated! Any solutions?

Answer

Gui picture Gui · Aug 26, 2015

I ran into the same problem and the only way I was able to open the CMD as administrator from CMD was doing the following:

  1. Open CMD
  2. Write powershell -Command "Start-Process cmd -Verb RunAs" and press Enter
  3. A pop-up window will appear asking to open a CMD as administrator