6

Normally in Windows Explorer, I can open a command window by shift right-clicking in the folder. I love this feature.

However sometimes this item is missing from the context menu. This is really frustrating. On investigation, it's precisely when window is labelled 'documents library'.

How can I fix this? Either so the 'open command window' items shows up in both cases, or to force all Windows Explorer windows to be of the first kind.

enter image description here

enter image description here

7
  • 3
    Libraries are potentially a union of many folders at the same time. How would your system know which member folder to use?
    – Zoredache
    Jul 15, 2013 at 22:59
  • possible duplicate of Can I browse windows 7 libraries from the command prompt? Jul 15, 2013 at 23:01
  • @Zoredache what do you mean? I understand there's both 'public documents' and 'my documents', but there's only one folder on my computer called felicitous-desktop, it's at C:\Users\Matt\Documents\felicitous-desktop. Jul 15, 2013 at 23:11
  • @Raystafarian that's not my question! I'm asking how do I open a command window at C:\Users\Matt\Documents\felicitous-desktop (that's an ordinary folder) from a Windows Explorer of the second kind. Jul 15, 2013 at 23:12
  • 1
    The documents folder is a library which is why it doesn't work. You should either not include that folder in the library, or move that folder to a different place c:\folder Jul 15, 2013 at 23:17

3 Answers 3

5

I located a solution here for adding the 'Open Command Window Here' option to the Context Menu for Library Folders.

You just have to add a few registry keys:

HKEY_CLASSES_ROOT\LibraryFolder\background\shell
HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd (set value to what you want to be displayed on the right click menu, e.g. "Open command window here"
HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd\command (set value to "cmd.exe /k")

If you're not familiar with the registry editor, you can just copy the following text into Notepad, save it as whatever.reg, and double click it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd]
@="Open command window here"
[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd\command]
@="cmd.exe /k"

I did it in a slightly different way, exactly copying the keys and values that appeared in the cmd key within the Directory/background folder. The result is a little different, as the command window is opened at the location you expect (the current folder), rather than "C:\Windows\System32" as with the above.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell]

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd]
"Extended"=""
"NoWorkingDirectory"=""
@="@shell32.dll,-8506"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd\command]
@="cmd.exe /s /k pushd \"%V\""

To address the comment by @Zoredache, this ambiguity exists only when the folder you are viewing is the union of folders, as indicated when the header section of your folder has something like this.

enter image description here

In this case, the location that the Command Window opens to is whichever directory in your Library is set as the 'Default Save Location'. Other than that, it behaves as expected.

2
  • Your registry script is invalid. There must be a a header such as REGEDIT4 or Windows Registry Editor Version 5.00 to allow the .REG file to work. After I did that, it worked fine. Apparently I am not allowed to edit and fix this
    – bryc
    Apr 30, 2016 at 23:35
  • Great work! I tried to make the edit and I believe it is awaiting review. Nov 8, 2016 at 22:57
3

For some reason, Libraries doesn't have the 'Open command window here' option like normal folders. But it's possible to add it by modifying the registry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd]
@="@shell32.dll,-8506"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd\command]
@="cmd.exe /s /k pushd \"%V\""

This registry script will enable the familiar option in Libraries. To install it, save the above as a .reg file and run it.

If for some reason it doesn't work or you want to remove it, save the following as a .reg:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd]
0

This might get you close: The page has a download for a .reg file that purportedly disables libraries in Win7, This oughtta prevent any situations where you are getting the library style explorer windows, but its a bit of a kludge

http://lifehacker.com/5354879/disable-the-new-libraries-feature-on-windows-7

Normally I would prefer to use (and recommend) pages which will actually list the steps rather than offering only a .reg file. I've seen this .reg on a few sites, but all of them decline to include a run down of the changes made, saying it is more complicated than a normal registry hack. I would strongly recommend reading through the .reg file first to be sure it's doing what you expect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.