Answers:
打开regedit.exe,转到HKEY_CLASSES_ROOT\Directory\shell\cmd
,获取密钥的所有权,添加用户帐户的完全权限,并将DWORD的名称从更改为,HideBasedOnVelocityId
以ShowBasedOnVelocityId
再次启用命令提示符输入。
或应用安德鲁·理查兹(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"=""
这非常容易完成
- 在“ 任务栏和开始菜单属性”窗口中,转到“导航”选项卡,然后取消选中“ 使用Windows PowerShell替换命令提示符”选项。
- 单击“应用”以使更改生效。
来源:在Windows 10中使用Power On On Power Menu替换命令提示符
附加来源:在Windows 10的Win + X Power User Tasks菜单中显示命令提示符或PowerShell
要访问Windows更改了此设置的所有位置,可以在获取每个有问题的密钥的所有权后使用以下注册表文件。
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"=-
我只是递归地获取and [HKCR\Directory]
和[HKCR\Drive]
key的所有权,并强制允许继承。
这将在Shift-右键单击上下文菜单中隐藏powershell,并使cmd可见。
使用简单的文本编辑器(如记事本),将以下代码保存到扩展名为.REG的文件中(例如MyImport.reg
)。然后双击保存的文件,并按照提示将其导入注册表:
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