Launching a website via windows commandline

I have a program launching a website via the following command.

cmd "start /max http://url.com"

When launching a website via this method it uses the default browser with its default settings for opening a new window. for example, Firefox and IE will open the window inside the tab of an existing window if they are set to do so. I have reports of IE 6 replacing the content of a current opened window with the content of url.com. I've tested this and sure enough when IE 6 is set as the default browser and with a current webpage opened the above will replace the content of the opened window with url.com rather than opening a fresh window.

Upon running some tests I see the command listed here:

cmd "start /max iexplore.exe http://url.com"

will consistently open a new window( with Internet Explorer of course) regardless of an existing window being present or not.

Can anyone tell me if I'm missing a silly setting in IE 6 or if there is a way to duplicate the "always open a new window" functionality exhibited by calling iexplore.exe directly, but with calling the user default browser instead.


Solution 1:

You can just use

explorer "https://google.com"

Which will launch your default browser and navigate to that site.

And on Mac I've using

open "https://google.com"

Solution 2:

start chrome https://www.google.com/ or start firefox https://www.google.com/

Solution 3:

To open a URL with the default browser, you can execute:

rundll32 url.dll,FileProtocolHandler https://www.google.com

I had issues with URL parameters with the other solutions. However, this one seemed to work correctly.

Solution 4:

IE has a setting, located in Tools / Internet options / Advanced / Browsing, called Reuse windows for launching shortcuts, which is checked by default. For IE versions that support tabbed browsing, this option is relevant only when tab browsing is turned off (in fact, IE9 Beta explicitly mentions this). However, since IE6 does not have tabbed browsing, this option does affect opening URLs through the shell (as in your example).

Solution 5:

This worked for me:

explorer <YOUR URL>

For example:

explorer "https://www.google.com/"

This will open https://www.google.com/ in your default browser.