Search code examples
windowscommand-linebrowsercmd

Launching a website via the 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 Internet Explorer will open the window inside the tab of an existing window if they are set to do so. I have reports of Internet Explorer 6 replacing the content of a current opened window with the content of url.com.

I've tested this and sure enough, when Internet Explorer 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.

Am I missing a silly setting in Internet Explorer 6, or is there 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?

Launching a website via the Windows commandline


Solution

  • Internet Explorer has a setting, located in ToolsInternet optionsAdvancedBrowsing, called Reuse windows for launching shortcuts, which is checked by default.

    For Internet Explorer versions that support tabbed browsing, this option is relevant only when tab browsing is turned off (in fact, Internet Explorer 9 Beta explicitly mentions this). However, since Internet Explorer 6 does not have tabbed browsing, this option does affect opening URLs through the shell (as in your example).