Advertisement

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.

Advertisement


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 folderAn 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 accessFile 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.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

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

  1. 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.

  2. 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.

    1. 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.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.