here is a script for finding out a default browser
http://www.autohotkey.com/forum/viewtop ... lt+browser
i tested this in FF:
Code:
#NoEnv
#SingleInstance Force
;;;;;#Persistent
;-----------------
;-- Document type
;-----------------
outputdebug
,Searching for the following registry key: HKEY_CLASSES_ROOT\.htm\
RegRead
,$DocumentType
,HKEY_CLASSES_ROOT
,.htm\
if not ErrorLevel
outputdebug -- Found the following value: %$DocumentType%
else
{
msgbox,
(ltrim
Routine halted. Error reading the following registry key:
HKEY_CLASSES_ROOT\.htm\
)
return
}
;-------------------------
;-- Default shell command
;-- for document type
;-------------------------
outputdebug,
(ltrim join
Searching for the following registry key:%A_Space%
HKEY_CLASSES_ROOT\
%$DocumentType%\
shell\
)
RegRead
,$DefaultShellCommand
,HKEY_CLASSES_ROOT
,%$DocumentType%\shell\
if not ErrorLevel
outputdebug -- Found the following value: %$DefaultShellCommand%
else
{
outputdebug -- NOT found. Setting to "open"
$DefaultShellCommand=open
}
;-----------------------
;-- Default web browser
;-----------------------
outputdebug,
(ltrim join
Searching for the following registry key:%A_Space%
HKEY_CLASSES_ROOT\
%$DocumentType%\
shell\
%$DefaultShellCommand%\
command
)
RegRead
,$WebBrowserCommand
,HKEY_CLASSES_ROOT
,%$DocumentType%\shell\%$DefaultShellCommand%\command
if not ErrorLevel
outputdebug -- Found the following value: %$WebBrowserCommand%
else
{
msgbox,
(ltrim join
Routine halted. Error reading the following registry key:%A_Space%
HKEY_CLASSES_ROOT\
%$DocumentType%\
shell\
%$DefaultShellCommand%\
command
)
return
}
;-----------------------
;-- Extract information
;-----------------------
outputdebug Before cleanup - $WebBrowserCommand=%$WebBrowserCommand%
;-- Remove double-quotes around the program path (if they exist)
if SubStr($WebBrowserCommand,1,1)=""""
{
StringTrimLeft
,$WebBrowserCommand
,$WebBrowserCommand
,1
;-- Replace next occurance of DQ
StringReplace
,$WebBrowserCommand
,$WebBrowserCommand
,"
}
outputdebug After cleanup - $WebBrowserCommand=%$WebBrowserCommand%
SplitPath $WebBrowserCommand,$WebBrowserProgram,$WebBrowserPath
;-- Get rid of extraneous parameters
t_SPos:=InStr($WebBrowserProgram,A_Space)
if t_SPos
StringLeft $WebBrowserProgram,$WebBrowserProgram,t_SPos-1
;-- Note: Space is a weak delimiter for this test/StringLeft. Can
; probably be done better looking for an ".exe" in the string...
;---------------
;-- Final value
;---------------
blank = %$WebBrowserPath%\%$WebBrowserProgram%
run %blank% about:blank
return