how to write batch file to start ie with several tabs

In Internet Explorer, Open 3 tabs (or as many as you like). Go to your 3 favorite pages. Then click Tools > Internet Options > Click Use Current > Click Apply > Click OK.

Close IE and reopen it, and you will have your 3 pages starting at once.

Its possible to create a batch for IE, but it won't open 3 tabs, only 3 instances of IE.

Save as IE.bat:

START "" "C:\Program Files\Internet Explorer\iexplore.exe"
START "" "C:\Program Files\Internet Explorer\iexplore.exe"
START "" "C:\Program Files\Internet Explorer\iexplore.exe"

Here's a VB script to do what you want:

Imports Microsoft.Win32
Imports System.Environment

Public Class Form1
Private startPage As String
Private oPages() As String
Private regKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Internet Explorer\Main", True)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
startPage = regKey.GetValue("Start Page")
oPages = regKey.GetValue("Secondary Start Pages")

regKey.SetValue("Start Page", "")
regKey.SetValue("Secondary Start Pages", New String() {"", ""}, RegistryValueKind.MultiString)
End Sub

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
regKey.SetValue("Start Page", startPage)
If oPages Is Nothing Then
regKey.DeleteValue("Secondary Start Pages")
regKey.SetValue("Secondary Start Pages", oPages, RegistryValueKind.MultiString)
End If
End Sub
End Class

You can also also enter this direct to the Registry (this does the same as the first solution):

For primary homepage:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page

For secondary multistart pages:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Secondary Start Pages

Use a new line as a separator.

Also, you must have open all pages set in the registry: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TabbedBrowsing\OpenAllHomePages

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.