problem opening multiple web pages in multiple tabs in IE7

Posted on 2009-05-08
Last Modified: 2013-12-08
I wrote a simple batch file to open up eight html pages. I want them to open up in multiple tabs in the same browser. I have ie set to use the tabs. When I click on the bat file it does something weird...
It opens up page one in an IE browser.
Then, it opens page two in a second browser.
Then, it just sits there, in the middle of the bat file with the cursor blinking at me stupidly.
If I close the second browser, it opens pages three through eight in the first (still open) browser.
If I close the first browser, it does nothing. I have to then close the second browser too. Then, report three opens in it's own browser. I close it. Report four opens the same way. This happens with each of the following pages. Can someone explain to me what's happening? The code is (basically) as follows:

start iexplore.exe \\server\Reports\page1.html

start iexplore.exe \\server\Reports\page1.html








Open in new window

Question by:StarbuckLives

Accepted Solution

wellhole earned 100 total points
ID: 24338249
Create a file called myscript.js and insert script below. In your batch file, just run wscript myscript.js
var navOpenInBackgroundTab = 0x1000;

var oIE = new ActiveXObject("InternetExplorer.Application");


oIE.Navigate2("\\server\Reports\page2.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page3.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page4.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page5.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page6.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page7.html", navOpenInBackgroundTab);

oIE.Navigate2("\\server\Reports\page8.html", navOpenInBackgroundTab);

oIE.Visible = true;

Open in new window


Author Closing Comment

ID: 31579545
Perfect, thanks.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now