Neha Srivastava
Neha Srivastava

Reputation: 31

open Internet Explorer in Java without specifying the path

I want to open Internet Explorer dynamically with a new session, without knowing the exact path. I tried to open Internet Explorer from Java, using:

Runtime.getRuntime().exec("iexplore.exe -noframemerging http://google.com/");

But since iexplore.exe is not defined in a system variable, it was not able to find the location.

Please suggest me some way to move forward.

Upvotes: 2

Views: 4343

Answers (2)

alansiqueira27
alansiqueira27

Reputation: 8526

Process browser = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe \"http://www.google.com\"");

Upvotes: 0

Phil Anderson
Phil Anderson

Reputation: 3146

The follwoing will load google into your default browser on Windows...

Runtime.getRuntime().exec("cmd /c start http://google.com/");

Upvotes: 3

Related Questions