
Contents
If you’re anything like me, you’ve always relied on Windows 10’s “Open command window here” context menu to access your favorite command-line tool. However, in recent versions of Windows 10, Microsoft has begun to phase this option out in favor of PowerShell.
As a result, when you want to open CMD in a folder you have to navigate there manually via commands. If you’re a heavy CMD user, this gets frustrating pretty quickly. Instead, we’re going to show you how to open Command Prompt in a folder again, both when you right-click a folder and in empty space.
If you don’t use PowerShell at all, we’ll also show you how to remove the “Open PowerShell window here” context item for a cleaner UI. Let’s start:
How to Add “Open command window here” to the Folder Context Menu
Though Windows 10 doesn’t have a built-in setting for returning the feature, it’s not too difficult to pull off. All it requires is a registry tweak and a couple of permissions changes.
- Open the Registry Editor
Press Start and then type “Registry Editor”. Click the top result.
- Navigate to the CMD key and change its permissions
Paste the following in the top bar of your Registry Editor to navigate to the cmd key:
Computer\HKEY_CLASSES_ROOT\Directory\shell\cmd
In your sidebar, right click the
cmd
folder and press “Permissions…” in the context menu. - Click “Advanced” at the bottom of the permissions window
- Press the “Change” button next to the “TrustedInstaller” owner
- Select your Windows user as the object name
To do so, type your name into the “Enter the object name to select” box and press “Check Names”. It should automatically populate with the full path to your username. Click “OK” when you’re done.
- Replace the owner on subcontainers and objects
Back in the main Advanced Security Settings screen, tick “Replace owner on subcontainers and objects”, then click “Apply” and “OK”.
- Allow the administrators group full control over the registry key
In the “Permissions for cmd” window, click on “Administrators” under the “Group or user names” heading and tick “Full Control”. Then press “OK” and “Apply”.
- Rename the “HideBasedOnVelocityId” registry entry
To do so, right-click it in the main pane and select “Rename”.
- Call it “ShowBasedOnVelocityId”
Make sure you name it exactly as above, capitals included, or it won’t work.
- Check your “Open command windows here” entry in Windows 10 File Explorer
Right-clicking any folder should now show you both the Open CMD in folder and Open PowerShell options.
How to Enable “Open command window here” for the Background Context Menu
If you want to add the “Open command prompt” here entry when you right-click the blank space in a folder, you need to enable it for the background context menu. The process is very similar to above, with a one important change – the registry key you edit:
- Open the Registry Editor
Press Start and then type “Registry Editor”. Click the top result.
- Click “Advanced” at the bottom of the permissions window
- Press the “Change” button next to the “TrustedInstaller” owner
- Select your Windows user as the object name
To do so, type your name into the “Enter the object name to select” box and press “Check Names”. It should automatically populate with the full path to your username. Click “OK” when you’re done.
- Replace the owner on subcontainers and objects
Back in the main Advanced Security Settings screen, tick “Replace owner on subcontainers and objects”, then click “Apply” and “OK”.
- Allow the administrators group full control over the registry key
In the “Permissions for cmd” window, click on “Administrators” under the “Group or user names” heading and tick “Full Control”. Then press “OK” and “Apply”.
- Rename the “HideBasedOnVelocityId” registry entry
To do so, right-click it in the main pane and select “Rename”.
- Name it “ShowBasedOnVelocityId”
The name should be exactly as shown, including any capitals.
- Right-click the background to open a Command Prompt Window in a folder
You should see both the “Open command window here” and “Open PowerShell window here” texts. In the next section, we’ll show you how to get rid of the latter.
How to remove ‘Open PowerShell window here’ from the Context Menu
As you’d probably expect, removing the “Open PowerShell window here” entry from the Windows context menu follows a similar process to adding the Open CMD in folder entry. However, there are a couple of important changes, so it’s worth paying attention:
- Open the Registry Editor
Press Start and then type “Registry Editor”. Click the top result.
- Search for the PowerShell registry key and change its permissions
You can find it by pasting the following into your Registry Editor search bar:
Computer\HKEY_CLASES_ROOT\Directory\shell\PowerShell
Right-click the “Powershell” folder in your sidebar and select “Permissions…” from the context menu.
- Click “Advanced” at the bottom of the permissions window
- Press the “Change” button next to the “TrustedInstaller” owner
- Press the “Change” button next to the “TrustedInstaller” owner
Type your username into the “Enter the object name to select” box and press check name. The full path to your user will automatically appear. Press “OK” once it has.
- Replace the owner on subcontainers and objects
Back in the main Advanced Security Settings screen, tick “Replace owner on subcontainers and objects”, then click “Apply” and “OK”.
- Allow the administrators group full control over the registry key
In the “Permissions for cmd” window, click on “Administrators” under the “Group or user names” heading and tick “Full Control”. Then press “OK” and “Apply”.
- Rename the “ShowBasedOnVelocityId” registry entry
To do so, right-click it in the main pane and select “Rename”.
- Name it “HideBasedOnVelocityId”
Make sure you type it exactly, including any capital letters. The changes should apply immediately.
- Check your Windows context menu to see if the PowerShell entry is gone
If you’ve done everything correctly, you should only see the “Open command window here” text when you right-click a folder.
There you go. You now know how to open Command Prompt in a folder again, and should have the tools to reverse the change if you need to. If you’re interested, we also have a roundup of 8 other ways you can open the Command Prompt. We also have a guide on how to enable Ctrl + C and Ctrl + V for copying and pasting in the tool.