views:

3696

answers:

2

How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this?

Thanks!

A: 

Unfortunately, there is no way to include multiple URLs as command-line parameters. Here is a a blog post which details another (fairly convoluted) way to do it via Javascript.

Ben Hoffstein
+6  A: 

A batch file will work as a quick and dirty solution.

@echo off
@setlocal

:openurl
set url=%~1

if "%url:~0,4%" == "http" (
   start "%ProgramFiles%\Internet Explorer\iexplore.exe" "%url%"
)
if NOT "%url:~0,4%" == "http" (
   start "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://%url%"
)

shift
if "%~1" == "" goto :end
goto :openurl

:end

Edit: added support for domain names without http handler prefix.

Wedge
This works well. Full URLs must be specified parameters: stackoverflow.com doesn't work while http://stackoverflow.com works.