单击文件夹的空白部分时,Windows shell将项添加到上下文菜单

use*_*527 26 windows registry shell contextmenu

对不起,如果之前有人询问,我一直在四处寻找,很难找到我想要的东西.

我知道如何将上下文菜单项添加到文件夹,如下所示:

[HKEY_CLASSES_ROOT\Folder\shell\console2]
@="Open Console2 Here"

[HKEY_CLASSES_ROOT\Folder\shell\console2\command]
@="C:\\Program Files\\Console\\console.exe -d \"\"%1\"\""
Run Code Online (Sandbox Code Playgroud)

但是,这只适用于右键单击文件夹.我想要它,以便您可以在文件夹中,并单击该文件夹的空白部分并获取上下文菜单项.我也尝试HKEY_CLASSES_ROOT\Directory\shell过,但它也是这样.

use*_*527 46

我想出了答案.实际上Directory\Background,该文件夹必须将空字符串值添加NoWorkingDirectory到其中,并且%1命令中的变为a%V

[HKEY_CLASSES_ROOT\Directory\Background\shell\console2]
@="Open Console2 Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\console2\command]
@="C:\\Program Files\\Console\\console.exe -d \"\"%V\"\""
Run Code Online (Sandbox Code Playgroud)

资料来源:saviert的评论见http://www.howtogeek.com/howto/windows-vista/make-command-prompt-here-always-display-for-folders-in-windows-vista#comment-57856

  • 仅供参考:这不适用于XP.该注册表项仅适用于Vista和更高版本的操作系统. (4认同)