Tuesday, August 7, 2018

Can I add a Windows Explorer context menu option to start command prompt in the selected directory?


When browsing in Windows Explorer, sometimes I want to start a command prompt "here", e.g. with the current browsed folder as the current directory.


For example, when I am browsing "D:\Foo\Bar\Bar1", I want to open the command prompt with current dir pointing to this directory. Normally what I do is



  1. Copy the current folder path from Windows explorer's address bar

  2. Open cmd via Start Menu > Run

  3. Type D: (because I have to change drive, the default is C:)

  4. Type "cd " and then paste the folder path
    that I copied earlier


I do it quite often in my daily work, and I think by adding a context menu I will improve my efficiency (and also having to do the above repeatedly can be kind of annoying). I imagine I can just Right-Click > Start cmd here and then I will have a command prompt already in D:\Foo\Bar\Bar1


Is this possible?


Answer




  1. Start / Run / regedit


  2. Navigate to the following keys in turn:


    HKEY_CLASSES_ROOT\Drive\shell\cmd
    HKEY_CLASSES_ROOT\Directory\shell\cmd
    HKEY_CLASSES_ROOT\Directory\Background\shell\cmd

  3. Under each in the right pane you'll see a REG_SZ string value called Extended. Just rename this to something else (in case you want to easily undo the change) or delete it (just that value):


    1


  4. Now you can simply right-click a drive or directory and have the Command Prompt option show up without having to press Shift.



No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...