注册表改右键菜单和默认程序

执行命令行命令安装注册表

  • 执行命令regedit /s C:/regbak.reg以静默安装;
  • regedit C:/regbak.reg显示安装提示信息;
  • 直接双击也可.

文件夹中的右键菜单

在注册表编辑器中定位到:HKEY_CLASSES_ROOT\Directory\Background\shell,在其下新建项,

例如: 在目录C:\Users\CharleeChan\AppData\Local\Microsoft\Windows\WinX\Group3下,有10 - Programs and Features.lnk程序与功能,右键打开,找到其目标,该目标即为卸载程序的命令.
命令为:%windir%\system32\control.exe /name Microsoft.ProgramsAndFeatures

则相应的.reg文件为:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Programs And Features]
"Icon"="control.exe"
@="Unistall Programs"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Programs And Features\command]
@="control.exe /name Microsoft.ProgramsAndFeatures"

要在文件夹空白处右键生成"目录树",可以使用以下注册表:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\CreateFolderTree]
"Icon"="cmd.exe"
@="生成目录树"

[HKEY_CLASSES_ROOT\Directory\Background\shell\CreateFolderTree\command]
@="cmd.exe /C TREE>tree.txt /F"

要在文件夹空白处右键生成"所有文件的全路径",可以使用以下注册表:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\CreateFolderList]
@="生成文件夹列表"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\CreateFolderList\command]
@="cmd.exe /C DIR /S/ON/B >list.txt"

文件上的右键菜单

  • 示例1:把Notepad3添加进右键菜单
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Notepad3]
"Icon"="D:\\Program\\Notepad3\\Notepad3.exe"
@="使用Notepad3编辑"

[HKEY_CLASSES_ROOT\*\shell\Edit with Notepad3\command]
@="\"D:\\Program\\Notepad3\\Notepad3.exe\" \"%1\""

  • 示例2: 把Paint.Net添加到右键菜单
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Edit with Paint.net]
"Icon"="D:\\Program\\paint.net\\PaintDotNet.exe"
@="使用Paint.Net编辑"

[HKEY_CLASSES_ROOT\*\shell\Edit with Paint.net\command]
@="\"D:\\Program\\paint.net\\PaintDotNet.exe\" \"%1\""

将txt文件的默认双击打开设置为Notepad3

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\txtfile\shell\open\command]
@="\"D:\\Program\\Notepad3\\Notepad3.exe\" \"%1\""
posted @ 2020-03-02 20:26  云远·笨小孩  阅读(631)  评论(0编辑  收藏  举报