Is it possible to switch from normal mode to administrator mode in command line? I don't want to open command line by right clicking and selecting "run as administrator". Thanks


The answer is no. The "full administrative token" is associated with an .EXE when it's launched. You need to start a new CMD.EXE to get full-admin privs. To make UAC a bit more bearable, you can enable "auto-admin approval" through group policy.

  • 1
    To make UAC more bearable you'd have to disable it entirely. Sep 14 '12 at 20:06
  • 4
    @AnsgarWiechers: I hope this comment was not serious. It seems a bit lame to encourage anyone to disable UAC completely.
    – Sk8erPeter
    Dec 31 '13 at 10:15
  • 1
    @Sk8erPeter I am quite serious about this. If you're aiming for a secure system: disable UAC and use separate accounts (an admin account for administrative tasks and an account without administrative privileges for day-to-day work). UAC is just a lame workaround that Microsoft invented so that their customers can remain members of the administrators group all the time without actually having admin privileges all the time. Jan 3 '14 at 10:26
  • @AnsgarWiechers: it's funny that you call UAC a "lame workaround" when it solves the problem of users logged in all the time with a user that is a member of the administrators group. If you did it on XP, all the programs could run with elevated privileges (so they could harm your system too). Now if you DO NOT disable UAC (which is recommended) it's only possible if you explicitly give them these privileges in the UAC popup (if being logged in as part of the admin group, you just don't have to type in the password all the time). Calling it lame is like calling Linux's sudo a lame workaround.
    – Sk8erPeter
    Jan 4 '14 at 11:42
  • 1
    @AnsgarWiechers: I agree, this is not the right place to discuss it. I think a right closure of this debate can be that disabling UAC entirely is a very lame thing to do. ;)
    – Sk8erPeter
    Jan 4 '14 at 13:36

Or from within Powershell:

Start-Process powershell -Verb runas
  • My powershell(on Win7) doesn't have the runas verb... should it? I checked with 'verb | findstr /B /C:"R"'. Runas isn't on the list.
    – Totem
    Jan 26 '15 at 12:33
  • For me, this is the most valuable answer, but I have to choose the "No" answer as the right one, because there is no possibility to switch the user modes. Thank you, Chad.
    – culter
    Jan 17 '18 at 15:05
  • How do you start the new powershell in the same path as the one into which you type this command? It opens in a default path instead of in the path where I was. Aug 4 at 15:14

How about this:

runas /user:administrator cmd.exe
  • To my understanding, this requires the actual Administrator account to be active (Enter the password for administrator:). It is not identical with simply running the command prompt with elevated privileges. Sep 14 '12 at 14:33

You can't really "switch" between the two modes, but there are some 3rd party tools that let you launch programs from the command line in the elevated admin. Provided you drop them into a working path, you could, for example, use "elevate cmd" from the start menu or from an existing command prompt to start a new session in the elevated mode.


You can have a shortcut to cmd.exe and just modify the Advanced properties tab to "Run as Administrator".


if you are in visual studio code, in configuration you can add this:

    "terminal.integrated.shellArgs.windows": [
        "-Verb runas"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.