Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch multiple Internet Explorer windows/tabs from batch file?

Tags:

I would like a batch file to launch two separate programs then have the command line window close. Actually, to clarify, I am launching Internet Explorer with two different URLs.

So far I have something like this:

start "~\iexplore.exe" "url1" start "~\iexplore.exe" "url2" 

What I get is one instance of Internet Explorer with only the second URL loaded. Seems the second is replacing the second. I seem to remember a syntax where I would load a new command line window and pass the command to execute on load, but can't find the reference.

As a second part of the question: what is a good reference URL to keep for the times you need to write a quick batch file?

Edit: I have marked an answer, because it does work. I now have two windows open, one for each URL. (thanks!) The funny thing is that without the /d approach using my original syntax I get different results based on whether I have a pre-existing Internet Explorer instance open.

  • If I do I get two new tabs added for my two URLs (sweet!)
  • If not I get only one final tab for the second URL I passed in.
like image 243
TheZenker Avatar asked Oct 09 '08 19:10

TheZenker


People also ask

How do I get Internet Explorer to automatically open multiple tabs?

Step 1: Open Internet Explorer. Step 2: Select the Tools button at the top-right of the window. Step 3: Choose the Internet Options button. Step 4: Type the addresses of the Web pages that you want to use as your startup tabs into the Home page field at the top of this window.

How do I batch a window?

To create a Windows batch file, follow these steps: Open a text file, such as a Notepad or WordPad document. Add your commands, starting with @echo [off], followed by, each in a new line, title [title of your batch script], echo [first line], and pause. Save your file with the file extension BAT, for example, test.


1 Answers

Try this in your batch file:

@echo off start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.google.com start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.yahoo.com 
like image 74
Rodger Cooley Avatar answered Sep 28 '22 10:09

Rodger Cooley