cmd in explorer file menu is grayed out

5

1

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.

hossein sadeghi

Posted 2015-07-02T16:32:01.323

Reputation: 81

Answers

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.

hossein sadeghi

Posted 2015-07-02T16:32:01.323

Reputation: 81

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 – 2015-07-02T21:29:34.793

please take a look at the revision. – hossein sadeghi – 2015-07-03T19:32:09.573

Perfect (with a litle help with the formatting). Well done! – DavidPostill – 2015-07-03T19:43:29.920