by pk (2 Submissions)
Category: Registry
Compatability: VB Script
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)
This code will determine your default browser.
Assumes
Copyright 2005 Paul Kurczaba
Code Returns
The function returns the location of your default browser.
Side Effects
None :)
Public Function DefaultBrowser()
On Error Resume Next
Dim Regentry As String
Set TheReg = CreateObject("Wscript.Shell")
Regentry = TheReg.RegRead("HKEY_CLASSES_ROOT\HTTP\shell\open\command\")
Regentry = Replace(Regentry, Chr(34), "")
Regentry = Mid(Regentry, 1, InStr(1, LCase(Regentry), ".exe") + 3)
DefaultBrowser = Regentry
End Function