Windows添加右键菜单【转载】

如何给注册表添加右键菜单

[转载自:https://www.cnblogs.com/cheungxiongwei/p/7541447.html]

  1. Win + R 组合键打开命令行
  2. 输入 regedit 打开注册表
  3. 找到 HKEY_CLASSES_ROOT\*\shell 目录,新建 name 项
  4. 来到 name 项目录,新建 command 项
  5. 来到 command 项目录,修改默认值 字符串值

    eg. C:\Program Files\Sublime Text 3\sublime_text.exe "%1"

Note:%1 前面是一个空格;如图:

name 层新建一个 icon 字符串值,键值添加图标路径即可给右键菜单添加图标,如图:

如何在注册表中添加右键菜单

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell 文件右键菜单

HKEY_CLASSES_ROOT\Directory\Background\shell 桌面右键菜单

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt

HKEY_CLASSES_ROOT\Folder\shell

如何删除右键菜单中图形属性和图形选项

1.找到注册表 HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers 项。
删除
HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\igfxcui 项;
HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\igfxDTCM 项;
即可。

Note:如果后续想恢复该项,建议备份注册表。

如何在右键菜单中添加注册DLL选项

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\dllfile\shell]

[HKEY_CLASSES_ROOT\dllfile\shell\register]
@="注册DLL文件"

[HKEY_CLASSES_ROOT\dllfile\shell\register\command]
@="regsvr32 %1"

[HKEY_CLASSES_ROOT\dllfile\shell\Unregister]
@="卸载DLL文件"

[HKEY_CLASSES_ROOT\dllfile\shell\Unregister\command]
@="regsvr32 /u %1"

一个在注册表中添加右键菜单的实例

//xxx.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\notepad]
@="notepad open"

[HKEY_CLASSES_ROOT\*\shell\notepad\command]
@="D:\\20170901工作文档\\notepad.6.9.2\\notepad++.exe %1"
posted @ 2021-01-21 08:48  JoyPoint  阅读(289)  评论(0编辑  收藏  举报