Jos*_*osh 29 browser windows-registry google-chrome command-line windows-10
我试过在 reg 键中设置默认值:
hkeycu>software>microsoft>windows>shell>associations>urlassociations>http
和https
。
尝试使用master_preference
文件。
尝试使用命令 switch --make-default-browser
。
到目前为止,这些都不起作用。
任何帮助,将不胜感激。打开任何批处理文件、注册表项、文件替换/编辑...基本上任何我可以自动化的东西。
小智 11
您是否尝试制作.vbs文件以自动将 Chrome 设置为默认浏览器?
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=google%20chrome"
WScript.Sleep 1200
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " "
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " "
WScript.Quit
Run Code Online (Sandbox Code Playgroud)
参考:用户“Raz”在 OSD 期间使 IE 成为 Windows 10 中的默认浏览器中的评论
小智 9
要更改 Windows 10 中的默认浏览器,请尝试使用 Christoph Kolbicz 的工具 - https://kolbi.cz/blog/2017/11/10/setdefaultbrowser-set-the-default-browser-per-user-on-windows-10-和-server-2016-build-1607/。
启动了SetDefaultBrowser.exe HKLM "Google Chrome"
,对我来说效果很好。
Judy Li的答案在 2021-01-04 构建的最新 Windows 10 上仍然对我有用。但是,我必须更新选项卡和睡眠命令的数量。
更新后的步骤是:
shell:startup
使用 [win]+[r] 或文件资源管理器打开文件夹VBS代码
Set WshShell = WScript.CreateObject("WScript.Shell")
' Open the default settings window
WshShell.Run "%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=google%20chrome"
WScript.Sleep 5000 ' Wait until open (adjust if necessary)
' Adjust number of tabs until you reach the browser choice setting
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
' Open the browser choice menu
WshShell.SendKeys " "
WScript.Sleep 500 ' Wait until open
WshShell.SendKeys "{TAB}" ' Move down one selection
WshShell.SendKeys " " ' Set current selection as default browser
WScript.Sleep 500 ' Wait until open
' Uncomment the line below to outomatically close the settings window
' WshShell.SendKeys "%{F4}"
WScript.Quit
Run Code Online (Sandbox Code Playgroud)
小智 6
以下是 Judy Li / Raz 解决方案的 PowerShell 版本:
function Set-ChromeAsDefaultBrowser {
Add-Type -AssemblyName 'System.Windows.Forms'
Start-Process $env:windir\system32\control.exe -ArgumentList '/name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=google%20chrome'
Sleep 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB} {TAB}{TAB} ")
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
77562 次 |
最近记录: |