How can I programatically set the default browser in Windows 10

allanx2000 picture allanx2000 · Apr 26, 2016 · Viewed 10.6k times · Source

I want be able to change the default browser (and other associations) via a C# program similar to how browsers have a "Make Browser As Default" option.

I've tried changing HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice but Windows just detects tampering, even if I restore both the Hash and ProgId to a previous value. Seems Hash is unique, time based

Answer

Sam picture Sam · Jul 10, 2017

You can do this by running a little program I wrote called Set Default Browser.