[Fix] “Cmd” is the Default Action for Folders (Right-click Menu)

Summary: Default right-click action changes to Cmd for folders in Windows 10. Double-clicking folders shows the association error message.

I’ve seen a few cases where the default action for folders somehow changed from Open to Cmd, showing up in bold when you right-click a file system folder. And clicking it shows the following file association error message:

This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.

Although the cause isn’t clearly known, all of the systems which had the problem were running Windows 10. Directory association settings had some keys and values missing, and one of these methods resolves the problem.

Fix #1

Right-click Start, click Command Prompt (Admin)

Type the following command:

reg add HKEY_CLASSES_ROOT\Directory\shell /ve /d "none" /f

Press ENTER.

If the same problem is seen when double-clicking drives, run this command:

reg add HKEY_CLASSES_ROOT\Drive\shell /ve /d "none" /f

That fixes the default double-click action (sets to "open") and there by resolves the problem.

Fix #2

Download Directory association fix (for Windows 10). For other operating Systems, check out File/Folder Association fixes pages at Windows Vista | Windows 7 | Windows 8 | Windows 10.

More Information

Running the following Reg.exe command from a Command Prompt window showed two things:

reg query hkcr\Directory\shell /s

1. The “Directory\shell” key didn’t have the (default) entry. It should be set to "none" (without quotes).

2. The "cmd\command" key was missing the value data for (default). It should be set to

cmd.exe /s /k pushd "%V"

Creating these entries fixed the problem.

15 thoughts on “[Fix] “Cmd” is the Default Action for Folders (Right-click Menu)”

  1. I had to contact Microsoft Support in the end as nothing I tried would work. They decided that my Windows 10 had corrupt files and they reinstalled Windows 10 and the problem now seems to be resolved. Thanks to those who tried to assist me.

    Reply
  2. This cmd problem haunted me for a week! Double-click or right click on drives and devices in My Computer gave error message about default program etc.

    Did Fix 2 and problem solved. Now opening with double left click and “Open” is highlighted and at top of context menu.

    Thank you!!!

    Reply
  3. how to remove the ‘cmd’ that appear in my menu box content.. it always appear when i click my menu box content in desktop..
    please help me, thankyou..

    Reply
  4. when i installed .net core sdk ,cmd and search options added to my context menu.
    first command worked for me,but the cmd and search options are still in the context menu.

    Reply

Leave a Comment

Exit mobile version
3 Shares
Tweet
Share3
Share