win10 右键菜单增加cmd.exe与powershell

需求描述

进入某个目录下,可以右键,打开cmd.exe 或是powershell。

操作方法

修改注册表:

把下面的四段,分别复制为四个后缀为:.reg的注册表类型文件。双机导入。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd_shell]
@="cmd.exe here"
"Icon"="C:\\Windows\\System32\\cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd_shell\command]
@="cmd.exe /s /k pushd \"%V\""

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd_shell]
@="open cmd.exe here"
"Icon"="C:\\Windows\\System32\\cmd.exe"

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

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Power_shell]
@="Power Shell here"
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Power_shell\command]
@="powershell.exe -noexit -command Set-Location -literalPath '%V'"

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Power_shell]
@="open PowerShell here"
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"

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

方法二:

打开注册表,手动添加

进入:HKEY_CLASSES_ROOT\Directory\shell\Power_shell,找到:Powershell,尝试删除里面的:Extended项,但是无法删除,所以,新建一个。

增加CMD.exe 或是PowerShell,方法类似。

增加的位置:

HKEY_CLASSES_ROOT\Directory\shell\Power_shell\

HKEY_CLASSES_ROOT\Directory\Background\shell\Power_shell

增加的项,按已有的cmd 与 Powershell新建。

需要建立:command项。

可以设置图标。

显示效果:

选择目录后,右键:

空白目录下,右键:

总结:

熟悉下注册表右键菜单添加的方法

猜你喜欢

转载自blog.csdn.net/tcjy1000/article/details/112006736