Reputation: 4358
I am writing a .bat file to open multiple url in one internet explorer in one tab.
I am able to open multiple url in multiple IE windows.
echo start...opening the url..
start "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.google.com
start "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.yahoo.com
start "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.facebook.com
But I actually wants to open one IE window ( one tab ) and i want to open the next url in the same tab ( neither in other tab nor in other IE window ).
Please let me know what is best way to achieve this. Any idea would be very useful to me.
Upvotes: 0
Views: 31323
Reputation: 1
I had this happen to me in work when opening multiple urls in a batch file and it was behaviour I did not want.
Have a look at Tools/Internet Options/Advanced/Re use windows....
You have to switch tabbed browsing off (it states), but I believe our version of IE in work might not support tabbed browsing, being so old. By disabling this option I got each url in a new window, which is what I was trying to achieve.
Upvotes: -1
Reputation: 7105
I can only do this with vbs. Save the following as IENav.vbs and double click it. Make sure IE is open prior to doing so.
Dim ShellApp, ShellWindows, IE
Set ShellApp = CreateObject("Shell.Application")
Set ShellWindows = ShellApp.Windows()
Dim i
For i = 0 To ShellWindows.Count - 1
If InStr(ShellWindows.Item(i).FullName, "iexplore.exe") <> 0 Then
Set IE = ShellWindows.Item(i)
End If
Next
IE.Navigate2("http://www.google.com")
wscript.sleep 3000
IE.Navigate2("http://www.yahoo.com")
wscript.sleep 3000
IE.Navigate2("http://www.facebook.com")
set ShellWindows = Nothing
set ShellApp = Nothing
set IE = Nothing
Upvotes: 1
Reputation: 8312
Same window, same tab --I don't think you can do that in IE unless you write your own frameset page, and open google in one frame and yahoo in another frame... the only way is to create a html page that pulls content from two websites and displays them side-by-side. A frameset is one way of doing this:
<HTML>
<FRAMESET cols="50%,50%">
<FRAME src="http://www.google.com/">
<FRAME src="http://www.yahoo.com/">
</FRAMESET>
</HTML>
However, many websites do not allow their content to be displayed in frames due to security reasons. Both Google and Twitter block frames... There may be other ways to accomplish this that are not blocked by websites, like using <iframe> elements. Still, the solution is a static page like the frameset example above.
You could easily write a batch file that would let you pass in two domain names on the command line, the batch file could generate the static html file and then open it, which would display the content of two or more websites on a single page (as in the example above).
Upvotes: 1