I did some research around the internet on how to get default browser's path.
I found only long codes, sometimes needing whole modules and APIs; so I decided to write my own method, just few lines of code and no APIs needed...
Here it's code.
I found only long codes, sometimes needing whole modules and APIs; so I decided to write my own method, just few lines of code and no APIs needed...
Here it's code.
Code
Function DefaultBrowser() As String
Dim regshell As Object
Set regshell = CreateObject("Wscript.Shell")
' Reads the registry value where is stored the default application to use with HTTP
DefaultBrowser = regshell.regread("HKEY_CLASSES_ROOT\HTTP\shell\open\command\")
' Removes shell parameters after the actual path, preserving only path included in double ' quotes
DefaultBrowser = Left(DefaultBrowser, InStr(1, DefaultBrowser, ".exe", vbTextCompare) + 4)
' Removes double quotes (")
DefaultBrowser = Replace(DefaultBrowser, Chr(34), vbNullString)
End Function
