Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

problem opening multiple web pages in multiple tabs in IE7

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
\\server\Reports\page2.html
\\server\Reports\page3.html
\\server\Reports\page4.html
\\server\Reports\page5.html
\\server\Reports\page6.html
\\server\Reports\page7.html
\\server\Reports\page8.html

start iexplore.exe \\server\Reports\page1.html
\\server\Reports\page2.html
\\server\Reports\page3.html
\\server\Reports\page4.html
\\server\Reports\page5.html
\\server\Reports\page6.html
\\server\Reports\page7.html
\\server\Reports\page8.html

Open in new window

0
StarbuckLives
Asked:
StarbuckLives
1 Solution
 
wellholeCommented:
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\page1.html");
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

0
 
StarbuckLivesAuthor Commented:
Perfect, thanks.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now