How to fix: Explorer and/or CMD not working 2012/12/10


Recently, I noticed the following problem on my Windows 8 computer (although I believe it can happen with other versions of Windows as well, at least Windows 7):

  • Clicking on the explorer icon in the taskbar with no folder window being open had no effect.
  • Right-clicking the explorer icon in the taskbar and choosing “Explorer” to start a new instance, or even trying to run explorer.exe manually (e.g. from the “Run” window) resulted in the following message: “This file does not have a program associated with it for performing this action.”
  • Trying to open a CMD window from a folder window using the menu item “Open Command Prompt Here” in the Explorer ribbon failed with the same message, although opening cmd.exe manually worked fine.

My first thought (and also the first Google search) told me that maybe the file association for “.exe” files got lost. This is another very confusing issue, but in this case it was probably not the problem because starting other programs like notepad.exe worked fine. There was no solution to be found on the internet, other than the suggestion to reinstall Windows.

After a bit of debugging, it turned out that Windows uses special file association verbs for opening a new explorer window for no particular folder as well as opening the command prompt from a folder window. You can find them in your registry at HKEY_CLASSES_ROOT\Folder\shell\opennewwindow and HKEY_CLASSES_ROOT\Directory\shell\cmd, respectively. If you cannot find them, that’s the problem. :)

Okay, if you didn’t understand the last paragraph, that’s no problem. The point is, two folder context menu entries (”Open in New Window” and “Open Command Window Here”) got removed. In my particular case I removed them myself because I used a software called “Right Click Editor” to move them in a sub-menu – oops. But there may be other reasons why they have been removed, for example because of a badly written installer.

Bottom line is: To solve the problem, I had to restore these registry settings. You can do that too. I have prepared a “.reg” file for you which you just need to import into your registry (double-click it): Download here!

This is what it contains:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\opennewwindow]
"OnlyInBrowserWindow"=""
"LaunchExplorerFlags"=dword:00000001
"MUIVerb"="@shell32.dll,-8517"
"MultiSelectModel"="Document"

[HKEY_CLASSES_ROOT\Folder\shell\opennewwindow\command]
"DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"

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

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

I hope I was able to help some people with this, as I didn’t find this solution on the internet before!

Tags: , , , ,


One Response to “How to fix: Explorer and/or CMD not working”

  1. William Burnside says:

    Thank you, thank you, thank you – I had the same problem, probably for the same reason since I also had used a context menu editor, and it was driving me absolutely crazy why windows key + e and clicking on explorer.exe would give that error message but everything else on the system seemed ok.

    I looked everywhere for the solution and had thought the only alternative might be to reinstall Windows, which I wasn’t eager to do – so thank you.

Leave a Reply

You must be logged in to post a comment.