🔗

How to replace the "Open Powershell window here" menu with something that actually works

2017-09-24

Since almost forever in Windows, it has been possible to shift+right-click in any explorer window to display a very convenient "Open command window here" menu.

In a recent Windows 10 update, Microsoft decided to make us understand a little more insistently they really would like us to use Powershell, and replaced this menu with an "Open Powershell window here" one.

I don't like Powershell

I don't like Powershell, and I don't intend to use it more.

For one, the Powershell command prompt tries hard to look like it is compatible with existing commands while it is really not: even though it looks like it works, you actually can't pipe binary data to another command or file with Powershell.

I also recently discovered another quirk, I guess related to the default color scheme of the prompt, that makes some texts completely disappear!

Do you notice the difference between the two following screenshots?

Classic command line prompt

Powershell prompt


This actually disrupted my workflow enough for me to try and find a way to get back to the previous menu.

Getting the old menu back, and more...

It's almost easy to configure the menu to one's tastes, and there are a lot of how-to online, but none that matched exactly what I wanted.

Since I'm going to have to edit the registry myself, I might as well add some other useful commands.

I settled on the following three:

  • The classic "Open command window here"
  • An "Open command window here as Administrator"
  • And an "Open bash window here", so that I can easily have all the power of unix in my Windows.

I also removed the annoying "Open in Visual Studio" menu that is showing without even holding shift.

Registry permissions

Unfortunately, executing a .reg file is not enough. You have to take ownership of some registry keys before you can edit them.

I did not manage to do it only on the root folder, so I had to take ownership and give myself full permissions on the following key:

Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell

Registry permissions

Once you have done that, you can edit the keys.

A note about re-enabling the "Open command window here"

It is possible to re-enable the menu by simply editing the Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\cmd key, but Windows keeps disabling it after each update.

I got tired after the third, and decided to add my own identical menu under the mycmd key.

Here are the .reg scripts:

0 comment



Formatting cheat sheet.
The current page url links to a specific comment.
The comment is shown highlighted below in context.

    JavaScript is required to see the comments. Sorry...