Solved
Forum Discussion
cunderw
6 years agoCommunity Hero
I haven't tested this personally, but you might try something like this in 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} ")
}
mboyce
6 years agoContributor
Thanks, I did try a similar way using a .vbs script based on the responses here: how-to-automate-setting-chrome-as-default-browser-in-windows-10
But that doesn't actually set the browser for me. It did open the Default apps window, and will open the Email setting but not actually choose anything.
I'm guessing based on the line:
[System.Windows.Forms.SendKeys]::SendWait("{TAB} {TAB}{TAB} ")
that there is still some UI action going on to get to the web browser settings or the chrome choice? I don't know as I'm not familiar with powershell or vbs scripts, but will keep researching/tinkering with it.