44

Shift-rightclicking an empty spot in Explorer displays "Open with PowerShell" instead of "Open with Command Prompt" since the Creators Update (2017-04). How can I get the old behaviour back where it shows "Open with Command Prompt"?

I tried changing the setting "Show PowerShell instead of Command Prompt when rightclicking the Start Menu or pressing Windows + X" to off, but that didn't change the shift+rightclick menu.

47

Open regedit.exe, go to HKEY_CLASSES_ROOT\Directory\shell\cmd, take ownership of the key, add your user account full permissions and change the name of the DWORD from HideBasedOnVelocityId to ShowBasedOnVelocityId to enable the command prompt entry again.

Enter image description here

Or apply Andrew Richards tweak to have both shown (cmd and PowerShell, also with entry to have elevate (running as admin) version),

Enter image description here

Enter image description here

by importing his .reg file (create a new txt file, paste the content and rename the file extension to reg):

Windows Registry Editor Version 5.00

; Command Prompt

[HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"

[HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open]
"MUIVerb"="Command Prompt"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas]
"MUIVerb"="Command Prompt Elevated"
"Icon"="cmd.exe"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""


; PowerShell

[HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"

[HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open]
"MUIVerb"="PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open\command]
@="powershell.exe -noexit -command Set-Location '%V'"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas]
"MUIVerb"="PowerShell Elevated"
"Icon"="powershell.exe"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas\command]
@="powershell.exe -noexit -command Set-Location '%V'"


; Ensure OS Entries are on the Extended Menu (Shift-Right Click)

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\background\shell\cmd]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\shell\Powershell]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\background\shell\Powershell]
"Extended"=""
| improve this answer | |
  • The 2nd method in your answer is good. But for someone who has no idea what to do with the .reg, just copy the file text into a .txt file & rename the file <name>.reg & double click it to run. Even though there is error message, the operation is success – KharoBangdo Sep 5 '17 at 4:41
  • 2
    How to restore from these reg keys? – vee Jan 13 '18 at 14:41
  • 2
    This answer didn't work for me until I applied the solution to all three of these registry paths: HKEY_CLASSES_ROOT\Directory\Background\shell\cmd, HKEY_CLASSES_ROOT\Directory\shell\cmd, and HKEY_CLASSES_ROOT\Drive\shell\cmd as directed here – Terrance Sep 5 '18 at 13:47
  • 1
    That .reg file works like a charm. – MC Emperor Sep 14 '18 at 22:03
  • 1
    @sdaau the blog is back online after MSFT restored all deleted blogs – magicandre1981 Apr 24 '19 at 13:35
12

As a quick alternative to the other answers, you can type cmd on the address bar of Explorer to open a command prompt cd'd to the current directory. (If you are more of a keyboard person, you can use the Ctrl + L shortcut to focus the address bar and then type cmd.)

This works for powershell too.

| improve this answer | |
8

This is extremely easy to accomplish

  • In the Taskbar and Start Menu Properties window, go to the Navigation tab and uncheck the Replace Command Prompt with Windows PowerShell option.
  • Click Apply for the change to take effect.

enter image description here

Sources:

enter image description here

Additional Source:

| improve this answer | |
  • 18
    This only changes the Windows + x menu, not the "Open with" menu when shift + rightclicking an empty spot in Explorer. – nelson2tm Apr 21 '17 at 17:12
  • 2
    no Ramhound this doesn't work. you ONLY change what shows up in WinX menu on right click on start button, not doing a rightclick inside Windows/File Explorer – magicandre1981 Nov 3 '17 at 15:13
1

To hit all of the locations where Windows has changed this, you can use the following registry file after taking ownership of each key in question.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8
"HideBasedOnVelocityId"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8
"ShowBasedOnVelocityId"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8
"HideBasedOnVelocityId"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8
"ShowBasedOnVelocityId"=-

[HKEY_CLASSES_ROOT\Drive\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8
"HideBasedOnVelocityId"=-

[HKEY_CLASSES_ROOT\Drive\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8
"ShowBasedOnVelocityId"=-

I would just take ownership of the [HKCR\Directory] and [HKCR\Drive] keys recursively and force permission inheritance.

Registry Permissions and Ownership setting

| improve this answer | |
0

A workaround without admin rights (e.g. without changing registry):

WINDOWS + R: shell:sendto (open Explorer in the send to directory of the current user (or go there manually with C:\Users\<user>\AppData\Roaming\Microsoft\Windows\SendTo.

Create a new .bat-file with cmd as only text (e.g. _cmd_here.bat).

You can now right-click on any file in the desired directory (with or without shift) -> send to -> _cmd_here.bat and the command line is opened in the directory of this file.

This costs you one click (actually mouseover) more to go into the send to submenu and you need at least one file in the directory, but beside that I think it is a solution for the problem.

| improve this answer | |
0

Here’s how to replace PowerShell with CMD:

  1. Open Registry Editor, simply by searching “regedit” on Cortana/Search or via Run (Win + R)
  2. On the address bar in the Registry Editor, paste “Computer\HKEY_CLASSES_ROOT\Directory\Background\shell” and hit enter
  3. From the sidebar, find “cmd” and right-click, then select Permissions
  4. From the permissions dialog, hit Advanced
  5. Hit the Change button next to the Owner field on the top of the Advanced dialog
  6. In the input field, enter your username — this can also be the email address for your Microsoft Account. Hit enter after typing in your username/email
  7. Back in the Permissions window, select Administrators from the top section and allow Full Control by checking the Allow check box on the dialog, then apply the changes and close the window
  8. Now, delete the DWORDHideBasedOnVelocityId” for CMD from the Registry Editor
  9. You may need to restart the File Explorer from the task manager to see the changes in action.

The above method will show CMD on the context menu when your Shift + Right Click in the File Explorer. But if you want to get rid of PowerShell, you can do so by following the steps below:

  1. Follow steps 1-7 from above — but change the permissions for “PowerShell” instead of the CMD.
  2. Once you apply the new permissions for PowerShell, delete the DWORD “ShowBasedOnVelocityId” for PowerShell
  3. After that, create a new DWORD and call it “*HideBasedOnVelocityId*
  4. Double click the newly created DWORD and change the hexadecimal value to “639bc8
  5. Once again, You may need to restart the File Explorer from the task manager to see the changes in action.
| improve this answer | |
0

The following instructions will restore the Open command window here context menu item, keeping the existing Open Powershell window here context menu item. Tested under Windows 10 1909.

  1. Press the Window key + R
  2. Type regedit. Click OK button
  3. To the Do you want to allow this app to make changes to your device? question, click Yes
  4. In regedit, navigate to Computer\HKEY_CLASSES_ROOT\Drive\shell\cmd by copying and pasting the registry path into the address bar at the top
  5. Right-click on cmd key in the left pane > Permissions... > Advanced button
  6. In the resulting window, click the Change hyperlink, next to Owner: at the top. By default the owner is Trusted installer
  7. In the resulting window, enter your username and click Check Names button. Click the OK button once it has recognised your username
  8. Back on the previous screen, working from top to bottom:
    • Tick Replace owner on subcontainers and objects
    • Click Enable Inheritance button
    • Tick Replace all child object permission entries with inheritable permissions from this object
    • Click the OK button
  9. Back in regedit, in the central pane, right-click HideBasedOnVelocityId and from the context menu choose Rename. Rename the value to ShowBasedOnVelocityId
  10. Navigate to Computer\HKEY_CLASSES_ROOT\Directory\shell\cmd via the address bar and repeat steps 5-9
  11. Navigate to Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\cmd via the address bar and repeat steps 5-9
  12. Close regedit
  13. Reboot your computer
| improve this answer | |
-1

This hides powershell from the Shift-Right Click context menu and makes cmd visible.

Using a simple text editor such as Notepad, save the following code to a file with the .REG extension (e.g. MyImport.reg). Then double-click the saved file and follow the prompts to import it into the Registry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Directory\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Drive\shell\cmd]
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Drive\shell\Powershell]
"HideBasedOnVelocityId"=dword:00639bc8
| improve this answer | |
  • Without explaining what this does and how to use it, this is not an answer. Please edit your post to clarify. – I say Reinstate Monica Dec 20 '18 at 11:35
  • done!.......... – Riccardo La Marca Dec 20 '18 at 11:44
  • 1
    Better, however see my edit for more of what I was expecting (not all users will know how to import content into the Registry). – I say Reinstate Monica Dec 20 '18 at 12:33
-3

In Windows 10 this is now included in the taskbar settings.

Windows 10 Taskbar Settings

| improve this answer | |
  • 3
    "This only changes the Windows + x menu, not the "Open with" menu when shift + rightclicking an empty spot in Explorer." -nelson2tm – Matt M. Apr 10 '18 at 21:18

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.