1. Create a registry file
Create the xxx.reg registry file with the following contents (take the Notepad++ program as an example):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CHZ]
@="URL:CHZ自定义协议"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\CHZ\shell]
[HKEY_CLASSES_ROOT\CHZ\shell\open]
[HKEY_CLASSES_ROOT\CHZ\shell\open\command]
@="D:\\dev\\tools\\Notepad++\\notepad++.exe"
Parameter Description:
Windows Registry Editor Version 5.00:注册表的版本,
F1:私有协议的key;可自定义
@="URL:F1 Protocol Handler":指定对应协议类型
Shell:关键字
Open:动作
Command:要执行的命令
@="D:\\dev\\tools\\Notepad++\\notepad++.exe" :命令值
2. Add a private protocol link in the html code
<a href="CHZ:www.gongstring.com">打开本地Notepad++程序</a>