Checking the default browser manually is easy: run
and take a look at the Web browser setting.
to open the default browser with its default (home) page(s), and check.
The true challenge is to get the default browser without human interaction.
I have seen many techniques and registry keys mentioned on the web, but so far none was reliable.
They all keep telling me my default browser is Internet Explorer, and I can assure you it isn't!
ASSOC (which actually searches
HKEY_CURRENT_USER\SOFTWARE\Classes\.html) and using its result in
ASSOC result appended, e.g.
HKEY_CURRENT_USER\SOFTWARE\Classes\htmlfile) did work back in the Windows XP and 7 era, but they no longer do in Windows 10.
Joe Caverly and Steve Robertson provided me with the "new" registry value locations:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\ProgID for local HTML files, and
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\ProgID for http(s) URLs.
This will return values like
To get the executable path, look in
which will return the path to the default browser's executable, e.g.
"C:\Program Files\Mozilla Firefox\firefox.exe".
However, a "copy" of
See GetDefaultBrowser.bat for more details.
page last modified: 2023-03-22