Opening default browser with dynamic URL

J

Josh

In my Java app, I would like to open some help files in the user's
default browser when they click a Help button. I found lots of
examples using this type of call:

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler
file://wherever/help.html");

(Substitute the real file path for "wherever")

But my problem is that I'm using a dynamic help system where the URL
that I am supposed to put into a browser to reach a given help file is
of this form:

file://wherever/index.htm?chapter=test&topic=help1

If I use that URL string in the call to Runtime.exec(), I get an error
message titled "Problem with Shortcut", saying "Unable to open file
""file://wherever/index.htm?chapter=test&topic=help1"".

It opens correctly if I remove the tag stuff at the end and just open:

file://wherever/index.htm

Any ideas on how I can do this?
 
J

Josh

Nobody's come across this problem before?

Well, is there any way to retrieve the path to the user's default
browser? Then I could directly run the browser with the dynamic
help, which seems to work (Runtime.exec("C:\Program Files\Internet
Explorer\iexplore.exe",
"file://wherever/index.htm?chapter=test&topic=help1"); opens
correctly).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top