Open relative Command Prompt or Explorer windows quickly - gHacks Tech News

Open relative Command Prompt or Explorer windows quickly

When it comes to opening command prompt windows or Windows Explorer / File Explorer windows, there is often a way to accomplish this faster.

How would you for instance open a command prompt window that uses the same path as the open Explorer window quickly?

Would you select File > Open command prompt > Open Command Prompt in File Explorer? Hold down the Shift-key while you right-click on the folder you want as the starting folder of a command prompt window? Use a third-party program that adds an option to the shell directly? Open Command Prompt manually and navigate to the folder manually as well?

All of those methods work, but they are not necessarily super fast. Now, how about typing cmd in the address bar of the Explorer window and hitting the Enter-key afterwards? Boom, a command prompt window opens with the current Explorer path as its starting path.

explorer open command prompt

This may be considerably faster than any of the options that you have used up until now. The only caveat is that you cannot launch a command prompt window with elevated rights using the method; at least none that I'm aware of.

The "hold down Shift and Ctrl" trick to run programs with elevated rights does not work unfortunately.

Now, what if you wanted to perform the operation the other way around? You are using the command prompt and want to launch an Explorer window that displays the contents of the active folder?

There are several options to do that. Either type "start ." to do so, or use "explorer .\". Both methods work and will open an Explorer window that displays the contents of the active command prompt folder.

And if you prefer Powershell or use it regularly, you can do the same using the command "ii .".

All three have in common that they spawn an Explorer window that displays the contents of the active location.

open explorer from command prompt

You can spawn an Explorer window that lists the contents of the default location as well using "explorer" without any parameters, but it may be faster to simply click on the Explorer icon in the taskbar if it is pinned to it, or use the shortcut Windows-E to open an Explorer window instead. (via Reddit)

Now You: How do you perform these tasks? Have any other methods of doing them?

Summary
Open relative Command Prompt or Explorer windows quickly
Article Name
Open relative Command Prompt or Explorer windows quickly
Description
Find out how to open relative command prompt windows or Windows Explorer / File Explorer windows quickly using simply shortcuts.
Author
Publisher
Ghacks Technology News
Logo




  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. Nik said on October 23, 2016 at 2:20 pm
      Reply

      Did you disable comments in mobile theme? Not able to view comments on my phone.

      1. RichardT said on October 23, 2016 at 10:50 pm
        Reply

        I also don’t see comments when viewing ghacks on my phone.

    2. Robert G. said on October 23, 2016 at 2:36 pm
      Reply

      Try Open Command Prompt Shell Extension 2.1.0.1 (x86x64):

      http://code.kliu.org/cmdopen/

      or

      http://www.softpedia.com/get/System/OS-Enhancements/Open-Command-Prompt-Shell-Extension.shtml

      Tested with Win10 Pro 64-bit.

    3. peter said on October 23, 2016 at 4:26 pm
      Reply

      Neat trick, thanks!

    4. Pete said on October 23, 2016 at 4:49 pm
      Reply

      Best method, import this into registry (adds context menu item for cmd prompt (for desktop and explorer drive & directory context menus)):

      Windows Registry Editor Version 5.00

      [-HKEY_CLASSES_ROOT\Directory\shell\runas]

      [HKEY_CLASSES_ROOT\Directory\shell\runas]
      @=”CMD Prompt”
      “Icon”=”cmd.exe”

      [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
      @=”cmd.exe /s /k pushd \”%V\””

      [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

      [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
      @=”CMD Prompt”
      “Icon”=”cmd.exe”

      [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
      @=”cmd.exe /s /k pushd \”%V\””

      [-HKEY_CLASSES_ROOT\Drive\shell\runas]

      [HKEY_CLASSES_ROOT\Drive\shell\runas]
      @=”CMD Prompt”
      “Icon”=”cmd.exe”

      [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
      @=”cmd.exe /s /k pushd \”%V\””

      1. Delt said on October 23, 2016 at 11:26 pm
        Reply

        How is this different than using Shift-right click?

    5. pd said on October 23, 2016 at 6:36 pm
      Reply

      That’s a nifty power user trick. Thanks.

    6. pHROZEN gHOST said on October 23, 2016 at 7:31 pm
      Reply

      I like the initial one using the explorer. But, I added both normal and elevated to the quick access toolbar.

      1. Donkeyfumbler said on October 24, 2016 at 1:35 pm
        Reply

        Nice – thanks for the tip.

    7. Zinc Whiskers said on October 23, 2016 at 10:40 pm
      Reply

      Just click on “File”…then select “Open Command Prompt”

      1. mc said on November 16, 2016 at 2:31 am
        Reply

        this.

    8. RossN said on October 23, 2016 at 10:54 pm
      Reply

      I use Q-DIR. Click on ‘lightning bolt’. Click on CMD.

      Just checked using the following batch file, and it doesn’t get me elevated permissions.
      @echo off
      goto check_Permissions
      :check_Permissions
      echo Administrative permissions required. Detecting permissions…
      net session >nul 2>&1
      if %errorLevel% == 0 (
      echo Success: Administrative permissions confirmed.
      ) else (
      echo Failure: Current permissions inadequate.
      )
      pause >nul

    9. SubgeniusD said on October 24, 2016 at 2:49 am
      Reply

      Why not just pin to taskbar? Opens in a split second.
      Start menu->All Programs->Accessories->Command Prompt
      R-click select “Pin to Taskbar”
      From taskbar
      R-click select Properties.
      Properties screen->Shortcut tab->Advanced button
      Advanced Properties screen check “Run as Administrator”

    10. Victor said on October 24, 2016 at 9:24 am
      Reply

      What about File-> Cmd or Powershell submenus , right click on the ones you want to pin it to quick access. Then just press Alt+ the number assigned to it.

      http://imgur.com/a/parF1

    11. didihu said on October 24, 2016 at 12:33 pm
      Reply

      subgenius..it doesn’t work on windows10 ! or i don’t understand (i’m french)

      1. SubgeniusD said on October 25, 2016 at 3:11 am
        Reply

        Sorry – I’m still on Win 7 Pro (and Linux).

        Win 10 is actually a bit simpler: http://lookpic.com/O/i2/1445/ZT73HmA9.png

    12. Anonymous said on October 24, 2016 at 3:08 pm
      Reply

      Thenks!!! Best tips I’ve seen in a few years!!!
      I always wonder if there is any more hidden shortcuts like these still unknown for me..

    13. Alessandro Tristan said on October 26, 2016 at 8:21 am
      Reply

      Thanks. I didn’t know they exists… :)

    14. Brent Jones said on October 26, 2016 at 5:09 pm
      Reply

      thank you Martin for the tips

    Leave a Reply