【问题标题】:Make context menu submenu per user in Windows Explorer在 Windows 资源管理器中为每个用户创建上下文菜单子菜单
【发布时间】:2020-01-14 16:33:07
【问题描述】:

我正在尝试按照this answer 在 Windows 资源管理器中创建一个包含一些自定义命令的子菜单,但需要在 HKEY_CURRENT_USER 中执行所有操作。虽然我能够在该联系人中创建子菜单,但我找不到以这种方式创建子命令的方法。

答案说他们应该在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell', so I tried what I thought would be the user equivalentHKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell`,但这似乎没有任何效果。

有没有办法创建这些子命令,以便 Explorer 在 HKEY_CURRENT_USER 上下文中找到它们?

【问题讨论】:

    标签: windows contextmenu explorer


    【解决方案1】:

    我找到了一个无需将条目添加到非用户可写注册表位置即可工作的解决方案:

    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\testmenu]
        "MUIVerb"="Nice Name"
        "subcommands"=""
        "Icon"="c:\\path\\to\\icon.ico"
    

    注意subcommands 条目的值为空字符串,这似乎很重要。

    对于出现在菜单中的任何子命令,添加以下内容:

    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\testmenu\Shell\subcommandname]
        @="Nice Name of Subcommand"
        "Icon"="c:\\path\\to\\another_icon.ico"
    
    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\testmenu\Shell\subcommandname\command]
        @="c:\path\to\command.exe"
    

    这会将目录的子菜单放在资源管理器的左侧窗格中,主窗口使用基本路径HKEY_CURRENT_USER\Software\Classes\Directory\shell,文件使用HKEY_CURRENT_USER\Software\Classes\*\shell

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-11
      相关资源
      最近更新 更多