终极效果图
1.添加自定义的Cmd命令【带图标】
1.1 打开运行 进入注册表编辑器
快捷键 Win+R
打开运行,输入 regedit
进入注册表
1.2 注册表进入对应路径 新建项OpenCmd
计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
Background
的 shell
目录下新建项,取名 OpenCmd
1.3 cmd取名【此处就取名为cmd
】
这里的取名就是鼠标实际右键时显示打开cmd的名称,如↓
1.4 给cmd命令赋值【2步走】
1.4.1 OpenCmd下新建 command
项
1.4.2 command项赋值【实际打开cmd的命令值】
cmd.exe -noexit -command Set-Location -literalPath \"%V\"
至此,基本的右键打开
cmd
的功能实现,下面是附上右键cmd的图标
1.5 添加右键cmd的图标
实际就是找到cmd程序的位置,选则 cmd.exe 文件的 Icon 图标
复制cmd的路径
C:\Windows\system32
,后边补上\cmd.exe
,组成最终 cmd 图标的数值数据 具体的数值名称和数值数据如下↓
切换到 OpenCmd
项下,在空白页右键新建 字符串值(S)
数值名称:Icon
数值数据:C:\Windows\system32\cmd.exe
至此cmd图标添加完成,效果如下↓
2.添加自定义的Powershell命令【带图标】
2.1 注册表进入对应路径 新建项OpenPowershell
计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
Background
的 shell
目录下新建项,取名 OpenPowershell
2.2 powershell取名【此处就取名为powershell7
】
因个人用的是Powershell7的版本,故取名 powershell7
这里的取名就是鼠标实际右键时显示打开powershell的名称,如↓
2.3 给cmd命令赋值【2步走】
2.3.1 OpenoPowershell下新建 command
项
2.3.2 command项赋值【实际打开powershell7的命令值】
此处注意,如果是默认Powershell,版本会是Powershell5.x
但此处本机已升级Powershell7.x【如下图】
所以实际打开powershell5.x的命令值与powershell7.x会有所区别
具体区别如下↓ Powershell5.x
powershell.exe -noexit -command Set-Location -literalPath \"%V\"
Powershell7.xpwsh.exe -noexit -command Set-Location -literalPath \"%V\"
可复制代码块↓
powershell.exe -noexit -command Set-Location -literalPath \"%V\"
pwsh.exe -noexit -command Set-Location -literalPath \"%V\"
至此,基本的右键打开
powershell
的功能实现,下面是附上右键powershell的图标
2.4 添加右键powershell7的图标
切换到 OpenPowershell
项下,在空白页右键新建 字符串值(S)
数值名称:Icon
数值数据:Powershell5.x C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Powershell7.x C:\Program Files\PowerShell\7\pwsh.exe
至此powershell图标添加完成,效果如下↓