|
最新版Win10和Win11中,通过修改注册表来关联文件类型的方法已失效,详情可参考www。cnblogs.com/h2zZhou/p/6654424.html
常见的解决方案是楼主提到的SetUserFTA和SFTA(github.com/DanysysTeam/SFTA)
我两个都试用过,最终保留了SFTA,能完美解决我的所有问题:用脚本静默执行关联常用文件格式,并设置Centbrowser为默认浏览器。
脚本如下:
::文件关联和协议关联
set "exe=%~dp0chrome.exe"
set "pid=CentHTM"
%~dp0SFTA.exe --reg "%exe%" ".htm" "%pid%"
%~dp0SFTA.exe --reg "%exe%" ".html" "%pid%"
%~dp0SFTA.exe --reg "%exe%" "http" "%pid%"
%~dp0SFTA.exe --reg "%exe%" "https" "%pid%"
%~dp0SFTA.exe --reg "%exe%" "ftp" "%pid%"
::导入默认浏览器所需的注册表
regedit /s "%~dp0#)chrome.reg"
#)chrome.reg内容如下
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CentHTM]
@="Cent HTML Document"
"AppUserModelId"="CentBrowser"
[HKEY_CLASSES_ROOT\CentHTM\Application]
"AppUserModelId"="CentBrowser"
"ApplicationIcon"="C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe,0"
"ApplicationName"="Cent Browser"
"ApplicationDescription"="访问互联网"
"ApplicationCompany"="Cent Studio"
[HKEY_CLASSES_ROOT\CentHTM\DefaultIcon]
@="C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe,0"
[HKEY_CLASSES_ROOT\CentHTM\shell\open\command]
@="\"C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe\" --single-argument %1"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet]
@="CentBrowser"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser]
@="Cent Browser"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\Capabilities]
"ApplicationDescription"="Cent Browser 是一款可高速运行网页和应用的网络浏览器。它快捷、稳定且易于使用。Cent Browser 内置的防护恶意软件和网上诱骗的功能可让您更安全地浏览网页。"
"ApplicationIcon"="C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe,0"
"ApplicationName"="Cent Browser"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\Capabilities\FileAssociations]
".htm"="CentHTM"
".html"="CentHTM"
".pdf"="CentHTM"
".shtml"="CentHTM"
".svg"="CentHTM"
".xht"="CentHTM"
".xhtml"="CentHTM"
".webp"="CentHTM"
".shtm"="CentHTM"
".mht"="CentHTM"
".mhtm"="CentHTM"
".mhtml"="CentHTM"
".xml"="CentHTM"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\Capabilities\Startmenu]
"StartMenuInternet"="CentBrowser"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\Capabilities\URLAssociations]
"http"="CentHTM"
"https"="CentHTM"
"irc"="CentHTM"
"mailto"="CentHTM"
"mms"="CentHTM"
"news"="CentHTM"
"nntp"="CentHTM"
"sms"="CentHTM"
"smsto"="CentHTM"
"snews"="CentHTM"
"tel"="CentHTM"
"urn"="CentHTM"
"webcal"="CentHTM"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\DefaultIcon]
@="C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe,0"
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\InstallInfo]
"ReinstallCommand"="\"C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe\" --make-default-browser"
"HideIconsCommand"="\"C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe\" --hide-icons"
"ShowIconsCommand"="\"C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe\" --show-icons"
"IconsVisible"=dword:00000001
[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\CentBrowser\shell\open\command]
@="\"C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe\""
[HKEY_CURRENT_USER\Software\RegisteredApplications]
"CentBrowser"="Software\\Clients\\StartMenuInternet\\CentBrowser\\Capabilities"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe]
@="C:\\Windows\\Temp\\app\\centbrowser\\chrome.exe"
"Path"="C:\\Windows\\Temp\\app\\centbrowser" |
评分
-
查看全部评分
|