Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a browser?

Status
Not open for further replies.

wduty

Programmer
Jun 24, 2000
271
US
Is there way to open a browser from a java program running in a dos prompt? [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Try Runtime.getRuntime().exec(command), where command is the path and file name to the program you want to execute.
Good luck!! [sig][/sig]
 
Thanks, I'll try that. [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
If you are running on windows you can do the following
Code:
Runtime.getRuntime().exec(&quot;rundll32 url.dll,FileProtocolHandler &quot; + &quot;[URL unfurl="true"]http://www.your-site.com&quot;);[/URL]
This will work for different browsers as well as different versions of windows. [sig][/sig]
 
Charming! Works. Thanks guys. [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top