[英]Set Microsoft Edge as default browser with PowerShelll
I'm doing a script that change the default browser to the Microsoft Edge and I have done this:我正在做一个脚本,将默认浏览器更改为 Microsoft Edge,我已经这样做了:
function Set-DefaultBrowser {
Add-Type -AssemblyName 'System.Windows.Forms'
Start-Process $env:windir\system32\control.exe -LoadUserProfile -Wait -ArgumentList '/name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=MSEdgeHTM'
Sleep 10
[System.Windows.Forms.SendKeys]::SendWait("{TAB}{TAB}{TAB}{TAB}{TAB} {ENTER}{ENTER} ")
}
Set-DefaultBrowser
But i don't like that is like a person where doing it opening the menu and that stuff I would like to do it like without showing it like that, it is posible to do it that way?但我不喜欢这样的人,就像一个人在打开菜单和我想做的事情而不像那样显示它,这样做是可能的吗?
My recommendation is to set the Regkeys that control default browser.我的建议是设置控制默认浏览器的 Regkeys。 Here is a link to a post showing how to do it with Chrome
这是一篇文章的链接,展示了如何使用 Chrome 进行操作
https://itectec.com/superuser/cmd-command-to-set-chrome-as-default-browser-windows-10/ https://itectec.com/superuser/cmd-command-to-set-chrome-as-default-browser-windows-10/
You'll notice the command needed but change the app name to that of Edge您会注意到所需的命令,但将应用名称更改为 Edge 的名称
Set-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice' -Name ProgId -Value 'ChromeHTML'
Set-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice' -Name ProgId -Value 'ChromeHTML'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.