How to programmatically launch your default browser

I’ve been searching for a way to do this for a while now and I think I may’ve finally found an answer.
Even though MSKB article 283225 (“HOWTO: Start Internet Explorer from a Java Application”) says it’s osolete, you can still use rundll32 passing 2 parameters: the first being the string (sans quotes) “url.dll,FileProtocolHandler” and the second being the URL you want to browse. I sat up a little test and it seems to work, even if the URL contains spaces or other characters that you would normally expect to require quoting.
MSKB article 174156 (“HOWTO: Programmatically Launch the Default Internet Browser”) documents how to use ShellExecute from VB which ishow the previous KB article says you’re supposed to go about it. I dunno, it just seems like the long way around. I suppose for long-term supportability, though, I should look into this. If anyone has any comments or suggestions, please drop me an email … I can use all the help I can get on this!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: