Open an elevated command prompt from the folder context menu

You might already know, the Windows Explorer has an extended context menu if you hold down “shift” while press the right mouse button. My personal favorite here is “Open command window here”. A prompt appears just in the folder you clicked. With lately increasing workload using the command-line this is a great help for me every day.

But as a developer often enough I require an elevated prompt. You can right-click a shortcut as select “Run As Administrator” to achieve this. But the prompt opened by above feature is never elevated. Also there is no command to elevate it. Sure, you could just run runas /user:Administrator@localhost cmd – but that is not running under your current user. Still I have not looked into the Linux subsystem features prepared by the Win 10 anniversary update – but I found this cool registry entry on the web which adds a second context menu entry which gives you an elevated prompt (of course, after UAC confirmation).

Credits belong here:

Have fun:


You may also like...

  • Really cool! Thanks for the tip.
    Is it possible to add this entry to the “Shift-Right-Click” menu without selecting an folder?

    • hypetsch

      Hi, if I don’t misunderstand you – replacing “Directory” with “Directory\Background” should do the trick.
      …you could also add shortcuts for e.g. “Drive”, “LibraryFolder”, “LibraryFolder\background”

      note: by adding
      below the “NoWorkingDirectory” you can also add the UAC – icon in front of the menu entry

      • ZoolWay

        Thanks hypetsch, that’s a great addition and the UAC icon make the menu item more recognizable. Great work!
        I updated the gist and the code here. Anyone can adopt to LibraryFolder or others if he likes.