如何更改 Windows 资源管理器的上下文菜单

Dha*_*tel 3 windows-registry windows-explorer

我想编辑 Windows 资源管理器的上下文菜单。我想用子菜单创建我自己的菜单,如图所示。并执行一些任务,例如复制并移动到其他目的地。任何人都可以告诉我如何使用注册表来做到这一点。

这可能吗?如果可能,请给我一步一步的答案。

Folder/file 
 -->Right click
    -->List of menu(Open,copy,send to,My menu name)
       -->My menu name ->(Copy,Move) 
          -->copy -->list of "fixed" folders or destination names
                     (They are already in my Hard disk) 
                     (On click on it it will perform copy operation).
Run Code Online (Sandbox Code Playgroud)

只是我想在上下文菜单中制作子菜单。和复制和移动操作,我想显示我在我的任何驱动器中创建的文件夹。并且有人单击该文件夹它将执行复制操作。 新菜单

and*_*415 5

创建级联菜单

在 Windows 7 及更高版本中,您可以直接通过注册表创建静态菜单。

由于HKEY_CLASSES_ROOT是组合HKEY_CURRENT_USERHKEY_LOCAL_MACHINE,可以注册在任何自定义谓词HKEY_CURRENT_USER\Software\Classes子项。这样做的主要优点是不需要提升权限。

来源:创建快捷菜单处理程序

注册表模板

这是您可以使用的每用户注册表模板。只需将其粘贴到一个新的文本文档中,然后应用您需要的更改。然后将其另存为.reg文件,并将其合并到注册表中。自定义菜单将添加到所有文件和文件夹中。

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu]
"MUIVerb"="My menu name"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd1]
@="Copy"
"AttributeMask"=dword:00000001
"AttributeValue"=dword:00000001
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-31246"

[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd1\command]
@="copy command here"

[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd2]
@="Move"
"AttributeMask"=dword:00000002
"AttributeValue"=dword:00000002
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-4145"

[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd2\command]
@="move command here"

[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu]
"MUIVerb"="My menu name"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd1]
@="Copy"
"AttributeMask"=dword:00000001
"AttributeValue"=dword:00000001
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-31246"

[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd1\command]
@="copy command here"

[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd2]
@="Move"
"AttributeMask"=dword:00000002
"AttributeValue"=dword:00000002
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-4145"

[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd2\command]
@="move command here"
Run Code Online (Sandbox Code Playgroud)

评论

  • AttributeMask值指定要测试的掩码位值的SFGAO值。
  • AttributeValue值指定被测试位的SFGAO值。
  • 所述ImpliedSelectionModel指定零为项动词,或非零的背景快捷菜单上的动词。

来源:创建快捷菜单处理程序

在上面的模板中,AttributeMaskAttributeValue分别设置为0x000000010x00000002。这些值与SFGAO_CANCOPYSFGAO_CANMOVE常量相关联,它们确定是否可以复制/移动指定的项目。

进一步阅读