Default Browser

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Joejr
Newbie
Posts: 6
Joined: Fri Aug 28, 2009 9:06 am
Location: WA. USA

Default Browser

Post by Joejr » Sun Aug 30, 2009 5:26 am

Can anyone tell me, if there is some script to find out what is the default browser? :?

User avatar
Joejr
Newbie
Posts: 6
Joined: Fri Aug 28, 2009 9:06 am
Location: WA. USA

Re: Default Browser

Post by Joejr » Sun Aug 30, 2009 8:20 am

Joejr wrote:Can anyone tell me, if there is some script to find out what is the default browser? :?
Never Mind

For those who are interested

Code: Select all

RegistryReadKey>HKEY_CURRENT_USER,Software\Classes\http\shell\open\ddeexec\Application,,strValue
:oops:

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Aug 30, 2009 7:06 pm

Another way is to use the FindExecutable function which returns the executable associated with a file type. We can ask it to tell us what is associated with .htm files:

Code: Select all

WriteLn>%TEMP_DIR%\temp.htm,r,nothing
LibFunc>shell32,FindExecutableA,fexeResult,%TEMP_DIR%\temp.htm,0,res
Position>NULLCHAR,fexeResult_3,1,pNull
MidStr>fexeResult_3,1,{%pNull%-1},defBrowserExe
Separate>defBrowserExe,\,pathParts
Let>defBrowserExe=pathParts_%pathParts_count%
DeleteFile>%TEMP_DIR%\temp.htm
MessageModal>Default Browser: %defBrowserExe%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Joejr
Newbie
Posts: 6
Joined: Fri Aug 28, 2009 9:06 am
Location: WA. USA

RE:Default Browser

Post by Joejr » Mon Aug 31, 2009 4:08 am

mtettmar wrote:Another way is to use the FindExecutable function which returns the executable associated with a file type. We can ask it to tell us what is associated with .htm files:

Code: Select all

WriteLn>%TEMP_DIR%\temp.htm,r,nothing
LibFunc>shell32,FindExecutableA,fexeResult,%TEMP_DIR%\temp.htm,0,res
Position>NULLCHAR,fexeResult_3,1,pNull
MidStr>fexeResult_3,1,{%pNull%-1},defBrowserExe
Separate>defBrowserExe,\,pathParts
Let>defBrowserExe=pathParts_%pathParts_count%
DeleteFile>%TEMP_DIR%\temp.htm
MessageModal>Default Browser: %defBrowserExe%
What if i wanted the browser version also?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts