HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
HKEY_CLASSES_ROOT\xxxxxxxxxx\shell\open\command
in the (Default) value, where xxxxxxxxxx is the browser designation found in the above key.
wscript.echo browser
Function Browser
Const HKEY_CURRENT_USER = &H80000001
Const strKeyPath = "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice"
Const strValueName = "Progid"
Dim strValue, objRegistry, i
' Browser list:
Dim blist(13,1)
blist(0,0) = "Internet Explorer" : blist(0,1) = "ie"
blist(8,0) = "Internet Explorer" : blist(8,1) = "IE.HTTP"
blist(11,0) = "Internet Explorer" : blist(11,1) = "IE.AssocFile.HTM"
blist(12,0) = "Internet Explorer" : blist(12,1) = "IE.FTP"
blist(13,0) = "Internet Explorer" : blist(13,1) = "IE.HTTPS"
blist(1,0) = "Edge" : blist(1,1) = "appxq0fevzme2pys62n3e0fbqa7peapykr8v"
blist(2,0) = "Firefox" : blist(2,1) = "firefox"
blist(9,0) = "Firefox" : blist(9,1) = "FirefoxURL"
blist(10,0) = "Firefox" : blist(10,1) = "FirefoxHTML"
blist(3,0) = "Chrome" : blist(3,1) = "chrome"
blist(4,0) = "Chrome" : blist(3,1) = "ChromeHTML"
blist(5,0) = "Safari" : blist(5,1) = "safari"
blist(6,0) = "Avant" : blist(6,1) = "browserexeurl"
blist(7,0) = "Opera" : blist(7,1) = "opera"
Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
objRegistry.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
browser = "Internet Explorer (Windows standard)": Exit Function
Else
For i = 0 To Ubound (blist, 1)
If Instr (1, strValue, blist(i,1), vbTextCompare) Then
Browser = blist(i,0) & " - User choice"
strBrowserPath = strValue
strBrowserPath = strBrowserPath & "\shell\open\command"
objRegistry.GetStringValue HKEY_CLASSES_ROOT,strBrowserPath,"",strValue
Browser = Browser & vbCrLf & "Browser command is: " & strValue
Exit Function
End If
Next
End If
browser = "Unknown web browser! (signature: '" & strValue & "')"
End Function
The mechanics of this are circuitously described in this link from Microsoft's MSDN site.
Specifically: