Sign in to follow this  
Followers 0
hastx

Finding Default Browser - and calling it

4 posts in this topic

Hello,

I have been working on a script that is working fine because I am calling IE in the script. The problem is that we have people using Firefox...I have searched these forums for a way to detect the default browser and call that but haven't found it.

Anyone have any ideas how to detect which browser is default?

Share this post


Link to post
Share on other sites



Yes... You havn't searched the forums too much if you havn't found this.

This is a snippet of a larger script by me.

$GetDefaultBrowser = RegRead("HKCR\HTTP\Shell\Open\Command", "")
$GetLastSection = StringSplit($GetDefaultBrowser, "\")
$GetProcessName = StringSplit($GetLastSection[$GetLastSection[0]], """")

$GetProcessName[1] would be the executable of the default internet browser.

Share this post


Link to post
Share on other sites

Can this be done but finding the media player instead?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Launch default browser:

ShellExecute("about:blank")

Launch default .mp3 player:

$key = RegRead("HKEY_CLASSES_ROOT\mp3file\shell\open\command", "")
$count = StringInStr($key, "/") - 2
$launchCmd = StringLeft($key, $count)
ShellExecute($launchCmd)

Launch default .mwv player and play sqVideo.wmv -

ShellExecute('"C:\sqVideo.wmv"')

Launch default email client:

ShellExecute("mailto:")

Launch default email client and fill in the To field:

ShellExecute("mailto:sam@squirrelybusiness.net")

Open default browser and navigate to Google:

ShellExecute("http://www.google.com")
Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0