在资源管理器中右键单击时,如何将“使用 Powershell 打开”更改为“使用命令提示符打开”?

nel*_*2tm 57 windows-10 windows-10-v1703

自创作者更新(2017-04)以来,按住 Shift 键右键单击资源管理器中的空白处会显示“使用 PowerShell 打开”而不是“使用命令提示符打开”。我怎样才能让旧的行为回到显示“用命令提示符打开”的地方

我尝试将设置“右键单击开始菜单或按 Windows + X 时显示 PowerShell 而不是命令提示符”更改为关闭,但这并没有更改 shift+右键单击菜单。

mag*_*981 62

打开 regedit.exe,转到HKEY_CLASSES_ROOT\Directory\shell\cmd获取密钥的所有权,添加您的用户帐户完全权限并将 DWORD 的名称从 更改HideBasedOnVelocityIdShowBasedOnVelocityId再次启用命令提示符条目

在此处输入图片说明

或应用Andrew Richards 调整以显示(cmd 和 PowerShell,也有条目以提升(以管理员身份运行)版本),

在此处输入图片说明

在此处输入图片说明

通过导入他的 .reg 文件(创建一个新的 txt 文件,粘贴内容并将文件扩展名重命名为 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"=""
Run Code Online (Sandbox Code Playgroud)

  • 在我将解决方案应用于所有三个注册表路径之前,这个答案对我不起作用:`HKEY_CLASSES_ROOT\Directory\Background\shell\cmd`、`HKEY_CLASSES_ROOT\Directory\shell\cmd`和`HKEY_CLASSES_ROOT\Drive\shell \cmd` 按照指示 [here](https://www.askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu/) (3认同)
  • 你的答案中的第二种方法很好。但对于不知道如何处理 .reg 的人,只需将文件文本复制到 .txt 文件中并将文件重命名为 <name>.reg 并双击即可运行。虽然有错误提示,但是操作成功 (2认同)
  • 如何从这些注册表项中恢复? (2认同)

Rap*_*ael 21

作为其他答案的快速替代方法,您可以cmd在资源管理器的地址栏中键入以打开cd指向当前目录的命令提示符。(如果您更喜欢键盘侠,可以使用Ctrl + L快捷方式聚焦地址栏,然后键入cmd。)

这也适用powershell

编辑(2021-08-02):正如@pj.dewitte 指出的,您可能需要使用.exe扩展名(即cmd.exepowershell.exe)。


Ram*_*und 7

这非常容易实现

  • 任务栏和开始菜单属性窗口中,转到导航选项卡并取消选中将命令提示符替换为 Windows PowerShell选项。
  • 单击应用以使更改生效。

在此处输入图片说明

资料来源:

在此处输入图片说明

额外来源:

  • 当 shift + 右键单击​​资源管理器中的空白处时,这只会更改 Windows + x 菜单,而不是“打开方式”菜单。 (19认同)
  • 没有 Ramhound 这不起作用。您只需在开始按钮上单击鼠标右键即可更改 WinX 菜单中显示的内容,而不是在 Windows/文件资源管理器中右键单击 (2认同)