5

Before reading, this is not about adding cmd to 'right click menu'. I have searched a lot! My question is not answered.

I'm using window 8.1 and I was able to run cmd from explorer file menu, but I accidentally removed a registry key and now the cmd is grayed out. When I am in c:\ or d:\, it's still active, but when I go to subfolders, it's disabled (grayed). It makes no different if a file or folder is selected or not.

any solution? does anyone know which registry key controls the contents of file menu in explorer menu bar?

This option already exists in windows 8.1. Normally you can go to file in menu bar and there is an option to open command prompt. Mine was working fine, but now it is grayed out.

I can open cmd by other means.

migrated from stackoverflow.com Jul 2 '15 at 18:04

This question came from our site for professional and enthusiast programmers.

2

How I think the problem originated: I ran a registry key that was posted on the internet which adds cmd to the "right click menu". Few days later I decided that I don't want that, so I deleted it, but mistakenly I deleted the registry key in another place.

The registry in the following key controls the right click menu

HKEY_CLASSES_ROOT\Directory\Background\shell

and in the following key, registries do something else.

HKEY_CLASSES_ROOT\Directory\shell

I'm guessing that when you right click on a file or folder, you're in shell and when you right click on the background, you're in background\shell.

Anyway, adding the following key revived the grayed command prompt in the explorer's file menu.

HKEY_CLASSES_ROOT\Directory\shell\cmd\command

with data:

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

if you do the same but add the last two keys to background\shell, you also get cmd when you right click.

Note: adding key is simple, just right click on an existing key (the ones that look like folders) and right click, select new key, and type in a name.

  • Welcome to Super User! While this may answer the question, it would be a better answer if you could provide some explanation why it does so. – DavidPostill Jul 2 '15 at 21:29
  • please take a look at the revision. – hossein sadeghi Jul 3 '15 at 19:32
  • Perfect (with a litle help with the formatting). Well done! – DavidPostill Jul 3 '15 at 19:43

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.