How to return the 'Open command window here' option to Windows 10's context menu

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:

Advertisement

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.

  1. Open the Registry Editor
     

    Press Start and then type “Registry Editor”. Click the top result.

    Windows 10 - Open Registry Editor

  2. 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.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions

  3. Click “Advanced” at the bottom of the permissions window
     

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions - Advanced

  4. Press the “Change” button next to the “TrustedInstaller” owner
     

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions - Advanced - Change Owner

  5. 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.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions - Advanced - Change Owner Check Names - Confirm

  6. 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”.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions - Advanced - Check Replace Owner - Apply - Ok

  7. 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”.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Permissions - Select Admin - Allow Full Control - Apply - Ok

  8. Rename the “HideBasedOnVelocityId” registry entry
     

    To do so, right-click it in the main pane and select “Rename”.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Rename HideBasedOnVelocityld

  9. Call it “ShowBasedOnVelocityId”
     

    Make sure you name it exactly as above, capitals included, or it won’t work.

    Windows 10 - Registry Editor - Browse the Path to Cmd- Rename HideBasedOnVelocityld to ShowBasedOnVelocityld

  10. 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.

    Windows 10 - File Explorer - Open Cmd on Context Menu Folder

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:

  1. Open the Registry Editor
     

    Press Start and then type “Registry Editor”. Click the top result.

    Windows 10 - Open Registry Editor

    1. Navigate to the CMD registry key and change its permissions
       

      Paste the following into your Registry Editor search bar:

      Computer\HKEY_CLASSES_ROOT\Directory\Backrgound\shell\cmd

      Right-click cmd in your side panel and select “Permissions…” from the context menu.

      Windows 10 - Registry Editor - Browse the Path to Cmd - Open Permissions

  2. Click “Advanced” at the bottom of the permissions window
     

    Windows 10 - Registry Editor - Browse the Path to Cmd - Permissions - Open Advanced

  3. Press the “Change” button next to the “TrustedInstaller” owner
     

    Windows 10 - Registry Editor - Browse the Path to Cmd - Permissions - Advanced Change Owner

  4. 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.

    Windows 10 - Registry Editor - Browse the Path to Cmd - Permissions - Advanced - Change Owner - Enter the Name - Check Names - Confirm

  5. 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”.

    Windows 10 - Registry Editor - Browse the Path to Cmd - Permissions - Advanced - Check Replace Owner - Apply - Ok

  6. 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”.

    Windows 10 - Registry Editor - Browse the Path to Cmd - Permissions - Select Admin - Allow Full Control - Apply - Ok

  7. Rename the “HideBasedOnVelocityId” registry entry
     

    To do so, right-click it in the main pane and select “Rename”.

    Windows 10 - Registry Editor - Browse the Path to Cmd - Rename HideBasedOnVelocityld

  8. Name it “ShowBasedOnVelocityId”
     

    The name should be exactly as shown, including any capitals.

    Windows 10 - Registry Editor - Browse the Path to Cmd - ShowBasedOnVelocityld

  9. 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.

    Windows 10 - File Explorer - Open Cmd on Context Menu Folder Background

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:

  1. Open the Registry Editor
     

    Press Start and then type “Registry Editor”. Click the top result.

    Windows 10 - Open Registry Editor

  2. 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.

    Windows 10 - Registry Editor - Browse the Path to Powershell - Open Permissions

  3. Click “Advanced” at the bottom of the permissions window
     

    Windows 10 - Registry Editor - Browse the Path to Powershell - Permissions - Open Advanced

  4. Press the “Change” button next to the “TrustedInstaller” owner
     

    Windows 10 - Registry Editor - Browse the Path to Powershell - Permissions - Advanced - Change

  5. 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.

    Windows 10 - Registry Editor - Browse the Path to Powershell - Permissions - Advanced - Change - Enter the Name - Check Names - Confirm

  6. 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”.

    Windows 10 - Registry Editor - Browse the Path to Powershell - Permissions - Advanced - Check Replace Owner - Apply - Ok

  7. 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”.

    Windows 10 - Registry Editor - Browse the Path to Powershell - Permissions - Select Admin - Check Full Control - Apply - Ok

  8. Rename the “ShowBasedOnVelocityId” registry entry
     

    To do so, right-click it in the main pane and select “Rename”.

    Windows 10 - Registry Editor - Browse the Path to Powershell - Rename ShowBasedOnVelocityld

  9. Name it “HideBasedOnVelocityId”
     

    Make sure you type it exactly, including any capital letters. The changes should apply immediately.

    Windows 10 - Registry Editor - Browse the Path to Powershell - HideBasedOnVelocityld

  10. 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.

    Windows 10 - File Explorer - Result

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.

Advertisement