无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
12
返回列表 发新帖
楼主: ko20010214
打印 上一主题 下一主题

[求助] 浏览器是检查哪个注册表项目知道自己是不是默认的浏览器呢

[复制链接]
31#
发表于 2024-5-10 12:02:39 | 只看该作者
ko20010214 发表于 2024-5-10 11:40
先查 http的shell open command,再查 https 的 , 有则返回 默认浏览器。
那是不是直接在注册表里添加这个 ...

试试 Smine 大神的批处理:(注意里面的路径)
rem init App
if not exist "%ProgramFiles%\Chrome\App" md "%ProgramFiles%\Chrome\App"
if not exist "%temp%\Chrome\Cache" md "%temp%\Chrome\Cache"

rem test readonly
mklink /d "%~dp0Cache" "%temp%\Chrome\Cache"
if exist "%~dp0Cache" (
  call :linkTemp

  rem pdf
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\Application" /v "ApplicationIcon" /d "\"%~dp0App\Chrome.exe\",0" /f
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\DefaultIcon" /ve /d "\"%~dp0App\Chrome.exe\",0" /f
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command" /ve /d "\"%~dp0App\Chrome.exe\" \"%%1\"" /f
) else (
  xcopy "%~dp0*" "%ProgramFiles%\Chrome\" /y /s /h /r /k /e
  mklink /d "%ProgramFiles%\Chrome\Cache" "%temp%\Chrome\Cache"

  PECMD LINK "X:\ProgramData\Microsoft\Windows\Start Menu\Programs\网络\Google Chrome","%ProgramFiles%\Chrome\App\Chrome.exe",,
  PECMD LINK "X:\Users\Public\Desktop\Google Chrome","%ProgramFiles%\Chrome\App\Chrome.exe",,

  rem pdf
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\Application" /v "ApplicationIcon" /d "\"%ProgramFiles%\Chrome\App\Chrome.exe\",0" /f
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\DefaultIcon" /ve /d "\"%ProgramFiles%\Chrome\App\Chrome.exe\",0" /f
  REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command" /ve /d "\"%ProgramFiles%\Chrome\App\Chrome.exe\" \"%%1\"" /f
)

goto :end


:linkTemp
  call :link "AutofillStates"
  call :link "BrowserMetrics"
  call :link "CertificateRevocation"
  call :link "Crashpad"
  call :link "Crowd Deny"
  call :link "ECSerivceProvidersConfig"
  call :link "FileTypePolicies"
  call :link "Floc"
  call :link "GrShaderCache"
  call :link "InterventionPolicyDatabase"
  call :link "MEIPreload"
  call :link "OriginTrials"
  call :link "pnacl"
  call :link "RecoveryImproved"
  call :link "Safe Browsing"
  call :link "SafetyTips"
  call :link "ShaderCache"
  call :link "SSLErrorAssistant"
  call :link "Subresource Filter"
  call :link "SwReporter"
  call :link "ThirdPartyModuleList64"
  call :link "TLSDeprecationConfig"
  call :link "WidevineCdm"
  call :link "ZxcvbnData"
goto :end

:link
  set f=%1
  set f=%f:"=%
  if exist "%~dp0Data\%f%" rd /s /q "%~dp0Data\%f%"
  if not exist "%temp%\Chrome\Data\%f%" md "%temp%\Chrome\Data\%f%"
  mklink /d "%~dp0Data\%f%" "%temp%\Chrome\Data\%f%"
goto :end

:end


如不行,再加一个注册表:设为默认浏览器
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.html]
@="ChromeHTML"

[HKEY_CLASSES_ROOT\.htm]
@="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\OpenWithList]
"a"="Chrome.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\OpenWithProgids]
"ChromeHTML"=hex(0):

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\UserChoice]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\OpenWithList]
"a"="Chrome.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\OpenWithProgids]
"ChromeHTML"=hex(0):

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mht\OpenWithList]
"a"="Chrome.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mht\OpenWithProgids]
"ChromeHTML"=hex(0):

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mht\UserChoice]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mht\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mhtml\OpenWithList]
"a"="Chrome.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mhtml\OpenWithProgids]
"ChromeHTML"=hex(0):

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mhtml\UserChoice]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mhtml\UserChoice]
"ProgId"="ChromeHTML"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts]
"ChromeHTML_.htm"=dword:00000000
"ChromeHTML_.html"=dword:00000000

点评

谢谢你的回复 。 这个批处理非常妙啊……我在 chrome109方少绿化版 (更新为109.0.5414.168版)win7可用的最新最高的版本 这个帖子里也提到过它。 http://bbs.wuyou.net/forum.php?mod=viewthread&tid=440067&  详情 回复 发表于 2024-5-10 12:22
回复

使用道具 举报

32#
 楼主| 发表于 2024-5-10 12:22:33 | 只看该作者
本帖最后由 ko20010214 于 2024-5-10 12:28 编辑
xmzhqw 发表于 2024-5-10 12:02
试试 Smine 大神的批处理:(注意里面的路径)
rem init App
if not exist "%ProgramFiles%\Chrome\App ...

谢谢你的回复 。

这个批处理非常妙啊……我在
chrome109方少绿化版 (更新为109.0.5414.168版)win7可用的最新最高的版本
这个帖子里也提到过它。
http://bbs.wuyou.net/forum.php?m ... 7&page=3#pid5268885

但由于我的环境是在kuer打造的win10PE里,登陆帐户为system, 不知道是不是这些因素影响了结果。

另外,这个批处理是给
84.0.4147.125 版本的chrome 使用的,有理由怀疑它不是在win10环境下测试的。
它里面带的 设置默认浏览器.REG 里面都没有提到 HASH值,估计在win10底下也无法起作用。

其实,有那些文件关联已经能让它正常使用了,是不是默认浏览器已经不重要了,(从实际使用效果来看它已经是默认的浏览器了),
现在就是解决 一打开chrome就提示 不是默认浏览器 的问题。 然后似乎也解决了。
最后就是 设置 里面 还是不认是默认的浏览器,这已经无关紧要了,留给处女座的去解决吧。

点评

你新建个html文件,双击看能不能调用浏览器打开,验证下  详情 回复 发表于 2024-5-10 15:30
回复

使用道具 举报

33#
发表于 2024-5-10 15:30:39 来自手机 | 只看该作者
ko20010214 发表于 2024-5-10 12:22
谢谢你的回复 。

这个批处理非常妙啊……我在

你新建个html文件,双击看能不能调用浏览器打开,验证下

点评

完全没问题啊。  详情 回复 发表于 2024-5-10 16:29
回复

使用道具 举报

34#
发表于 2024-5-10 15:59:49 来自手机 | 只看该作者
楼主研究出来了可以开个新帖讲解一下,我也想知道Win11PE下,怎么手动设定某个浏览器为系统默认浏览器!
回复

使用道具 举报

35#
发表于 2024-5-10 16:15:44 | 只看该作者
win7好说,win10,win11不好搞
回复

使用道具 举报

36#
 楼主| 发表于 2024-5-10 16:29:52 | 只看该作者
本帖最后由 ko20010214 于 2024-5-10 16:32 编辑
wjgyz740526 发表于 2024-5-10 15:30
你新建个html文件,双击看能不能调用浏览器打开,验证下

完全没问题啊。


看图标,看文件类型信息,都可以看出它是关联为chrome打开的。
双击一下,就用chrome打开了。


回复

使用道具 举报

37#
发表于 2024-5-10 21:57:44 | 只看该作者

点评

你确定? This program registers Mozilla Firefox Portable Edition with the Default Programs tool in Windows 7/Vista. 适用于Win7 或vista 。 而且它要求在有.NET的环境下。 现在讨论的是win10以上甚至是10  详情 回复 发表于 2024-5-10 22:21
回复

使用道具 举报

38#
 楼主| 发表于 2024-5-10 22:21:51 | 只看该作者
本帖最后由 ko20010214 于 2024-5-10 22:30 编辑

你确定?
This program registers Mozilla Firefox Portable Edition with the Default Programs
tool in Windows 7/Vista.
适用于Win7 或vista 。 而且它要求在有.NET的环境下。
现在讨论的是win10以上甚至是10PE的环境下。
This article lists two methods with which you can register Mozilla Firefox Portable Edition with Default Apps or Default Programs in Windows Vista through Windows 10/11.
这个好像是说这有两个方法能让你在windows vista 到windows10/11 都能设置firefox为默认的浏览器
但我没有环境可以试。

点评

确定, 我是用Firefox便攜版, win10 Win11都可以.  详情 回复 发表于 2024-5-11 00:28
回复

使用道具 举报

39#
 楼主| 发表于 2024-5-10 22:24:35 | 只看该作者
Windows系统中注册Firefox:

Windows系统使用的是HTML Application (HTA)的方式来注册默认浏览器。这个方法需要你先创建一个HTA文件,然后运行它。

创建一个名为register-firefox.hta的文件,并添加以下代码:

<script language="VBScript">
    strPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
    Set shell = CreateObject("WScript.Shell")
    shell.RegWrite("HKCR\http\shell\open\command\", strPath & " ""%1""")
    shell.RegWrite("HKCR\https\shell\open\command\", strPath & " ""%1""")
    shell.RegWrite("HKCR\ftp\shell\open\command\", strPath & " ""%1""")
    shell.RegWrite("HKCR\mailto\shell\open\command\", strPath & " ""%1""")
    MsgBox "Firefox is now the default browser.", 64, "Success"
</script>
在这个例子中,我们假设Firefox安装在C盘的"Program Files"文件夹中。你需要将这个路径改为你的Firefox实际安装路径。
回复

使用道具 举报

40#
发表于 2024-5-11 00:28:44 | 只看该作者
ko20010214 发表于 2024-5-10 22:21
你确定?
This program registers Mozilla Firefox Portable Edition with the Default Programs
tool  ...

确定, 我是用Firefox便携版, win10 Win11都可以.

点评

正常的情况下,Win10底下运行chrome,然后在设置里点击设置为默认浏览器,它会调用win10的设置程序来选择谁是默认的浏览器,这不需要其它的软件…… 我现在是讨论在Win10PE的环境下,它那个设置程序被精简了,调不  详情 回复 发表于 2024-5-11 00:47
回复

使用道具 举报

41#
 楼主| 发表于 2024-5-11 00:47:40 | 只看该作者
clautton 发表于 2024-5-11 00:28
确定, 我是用Firefox便携版, win10 Win11都可以.

正常的情况下,Win10底下运行chrome,然后在设置里点击设置为默认浏览器,它会调用win10的设置程序来选择谁是默认的浏览器,这不需要其它的软件……
我现在是讨论在Win10PE的环境下,它那个设置程序被精简了,调不出来,无法正常设置……而chrome又老喜欢检测自己是不是默认浏览器,还特别愿意提醒你。

点评

用这: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML] @="Firefox HTML" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\DefaultIcon] @="\"A:\\Pro-Inst  详情 回复 发表于 2024-5-30 20:23
回复

使用道具 举报

42#
发表于 2024-5-11 01:08:50 | 只看该作者
长见识了,感谢分享分享
回复

使用道具 举报

43#
发表于 2024-5-30 20:23:33 | 只看该作者
ko20010214 发表于 2024-5-11 00:47
正常的情况下,Win10底下运行chrome,然后在设置里点击设置为默认浏览器,它会调用win10的设置程序来选择 ...

用这:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML]
@="Firefox HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\DefaultIcon]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\",0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\shell\open\command]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\" -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL]
@="Firefox Portable URL"
"URL Protocol"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL\DefaultIcon]
@=hex(2):22,00,41,00,3a,00,5c,00,50,00,72,00,6f,00,2d,00,49,00,6e,00,73,00,74,\
  00,61,00,6c,00,6c,00,45,00,44,00,5c,00,4d,00,6f,00,7a,00,69,00,6c,00,6c,00,\
  61,00,2d,00,31,00,5c,00,50,00,61,00,6c,00,65,00,6d,00,6f,00,6f,00,6e,00,2d,\
  00,31,00,2e,00,65,00,78,00,65,00,22,00,2c,00,30,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL\shell\open\command]
@=hex(2):22,00,41,00,3a,00,5c,00,50,00,72,00,6f,00,2d,00,49,00,6e,00,73,00,74,\
  00,61,00,6c,00,6c,00,45,00,44,00,5c,00,4d,00,6f,00,7a,00,69,00,6c,00,6c,00,\
  61,00,2d,00,31,00,5c,00,50,00,61,00,6c,00,65,00,6d,00,6f,00,6f,00,6e,00,2d,\
  00,31,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,75,00,72,00,6c,00,20,00,\
  22,00,25,00,31,00,22,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox]
"LocalizedString"="Mozilla Firefox Portable Edition"
@="Firefox Portable"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\Capabilities]
"ApplicationName"="Mozilla Firefox, Portable Edition"
"ApplicationDescription"="Mozilla Firefox®, Portable Edition is the popular Mozilla Firefox web browser bundled with a PortableApps.com Launcher as a portable app, so you can take your bookmarks, extensions and saved passwords with you."
"ApplicationIcon"="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\",0"
"Hidden"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\Capabilities\FileAssociations]
".htm"="FirefoxHTML"
".html"="FirefoxHTML"
".shtml"="FirefoxHTML"
".xht"="FirefoxHTML"
".xhtml"="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\Capabilities\StartMenu]
"StartMenuInternet"="Firefox"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\Capabilities\URLAssociations]
"http"="FirefoxURL"
"https"="FirefoxURL"
"ftp"="FirefoxURL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\DefaultIcon]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\",0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\shell\open\command]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\shell\properties]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox\shell\properties\command]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\" -preferences"

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Firefox Portable"="Software\\Clients\\StartMenuInternet\\Firefox\\Capabilities"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox]
"LocalizedString"="Mozilla Firefox Portable Edition"
@="Firefox Portable"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\Capabilities]
"ApplicationName"="Mozilla Firefox, Portable Edition"
"ApplicationDescription"="Mozilla Firefox"
"ApplicationIcon"="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\",0"
"Hidden"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\Capabilities\FileAssociations]
".htm"="FirefoxHTML"
".html"="FirefoxHTML"
".shtml"="FirefoxHTML"
".xht"="FirefoxHTML"
".xhtml"="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\Capabilities\StartMenu]
"StartMenuInternet"="Firefox"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\Capabilities\URLAssociations]
"http"="FirefoxURL"
"https"="FirefoxURL"
"ftp"="FirefoxURL"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\DefaultIcon]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\",0"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\shell\open\command]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\shell\properties]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Firefox\shell\properties\command]
@="\"A:\\Pro-InstallED\\Mozilla\\Firefox.exe\" -preferences"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\RegisteredApplications]
"Firefox Portable"="Software\\Clients\\StartMenuInternet\\Firefox\\Capabilities"

点评

感谢回复。 这个是firefox的 ,不知道chrome能不能借鉴一下  详情 回复 发表于 2024-5-30 21:57
回复

使用道具 举报

44#
 楼主| 发表于 2024-5-30 21:57:11 | 只看该作者
clautton 发表于 2024-5-30 20:23
用这:

Windows Registry Editor Version 5.00

感谢回复。
这个是firefox的 ,不知道chrome能不能借鉴一下
回复

使用道具 举报

45#
发表于 2024-5-31 09:38:15 | 只看该作者
撸主是不是经常遇到设置默认浏览器失败的情况啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-6-15 01:51

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表