Open command prompt elevated in the current folder

At Winaero, I often write a number of articles which require you to open an elevated command prompt. A few examples are How to open elevated command prompt in Windows 10, Open elevated command prompt from non-elevated instance and A hidden way to open the command prompt in Windows 10. Today, I would like to share how you can open an elevated command prompt at the current folder you are browsing in Explorer. This saves your time.


As you might be knowing, by default, the elevated command prompt opens at the C:\Windows\System32 folder. This is not useful. You need to change the folder to another folder on your hard drive. It involves an additional console steps and commands. To speed up this process in Windows 7 and Windows Vista, I created ELE, a freeware app which you can use to open an elevated command prompt at the desired location.

But if you have the Ribbon enabled in File Explorer on Windows 10, Windows 8.1 or Windows 8, you can do this without any third party tool. Just follow these steps:

  1. Open the desired folder in File Explorer: File Explorer opened folder
  2. On the Ribbon, click File -> Open Command Prompt -> Open command prompt as administrator: File Explorer open command prompt current folder
  3. Confirm the UAC prompt and you are done!

File Explorer elevated command prompt current folder An even faster way is to add the item "Open command prompt as administrator" directly to the Quick Access toolbar. Right click the mentioned command and pick "Add to Quick Access toolbar". Then you will be able to open it with just one click from any folder you have open in File Explorer. File Explorer elevated command prompt quick access File Explorer elevated command prompt quick access 2

Tip: How to add any ribbon command to the Quick Access toolbar of File Explorer.

Update: This option has been removed in Windows 10 Creators Update. See Windows 10 build 14986 replaces Command Prompt with PowerShell everywhere. To resolve the issue, please refer to the following articles:

Also, see these articles:

 

That's it.

5 thoughts on “Open command prompt elevated in the current folder

  1. David Johnson

    When opening the cmd prompt as admin it always opens to C:\Windows\System32. If you do not open it as admin it opens to C:\Users\Username. I think you have things a bit backwards. I have never had it open to C:\Users\Username\Documents.

    Like or Dislike: Thumb up 1 Thumb down 0

    Reply
    1. Sergey Tkachenko Post author

      okay. But I often need to open it in c:\files\distr :)

      Like or Dislike: Thumb up 2 Thumb down 0

      Reply
      1. Jose_49

        Thanks. This will prove useful when tampering with stuff!!!

        Like or Dislike: Thumb up 0 Thumb down 0

        Reply
  2. Victor

    Good tip, I was doing it wrong, thanks.
    This is how I was doing it before in order to open current directory in file explorer:
    — Alt+D then Ctrl+C : that will copy current directory path
    — Win+X then A : that will prompt UAC to open CMD with elevated privileges
    — cd /d Ctrl+V [intro] : that will change the current directory to the one copied before

    Not as fast as clicking, however, as I want to use keyboard most of the times, it seems that using hotkeys is perfectly supported.
    Now I use:
    — Alt+F then M finally B

    You should also notice that running non elevated commands in the current directory, writing them in the Current Path edit box is totally acceptable, e.g.: Alt+D then write git clone …, or running an executable within that directory adding params for instance.

    Like or Dislike: Thumb up 0 Thumb down 0

    Reply
    1. Victor

      I didn’t notice that pressing ALT highlights the pinned CMD in the Quick Access Toolbar, giving them numbers, it is so much easier now, pressing Alt+3 in my case will launch the CMD with elevated privileges in the current directory, thanks, again.

      Like or Dislike: Thumb up 0 Thumb down 0

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *