平台:Windows 10
实现右键文件夹内空白处,提示 ”在此打开 cmd’、“在此打开 Powershell”:
Win + R 打开运行窗口,输入 regedit,打开注册表窗口

打开 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell

在 shell 下右键 > 新建项,命名为 open_cmd > 设值为 在此打开 cmd

在 shell 下右键 > 新建 > 字符串 Icon > 双击或右键编辑,赋值为 cmd 窗口的路径



综上所述,cmd.exe 文件路径为: C:\Windows\system32\cmd.exe
所用的 Icon 的值可以设为 cmd.exe 路径值
所以设置 Icon 的值为:

在 open_cmd 下右键 > 新建项,命名为 command,设值为 cmd.exe 路径

在任意文件夹空白处测试:

能够正常打开:

Win + R 打开运行窗口,输入 regedit,打开注册表窗口

打开 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell

右键点击 shell > 新建项,命名为 open_powershell,设置为 “在此打开 PowerShell”:

右键点击 open_powershell > 新建字符串,命名为 Icon > 设值为 powershell.exe 的路径:



C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
open_powershell > 新建项,命名为 command > 设值为 powershell.exe 路径

