1

I am trying to write a short powershell script so that when i start my computer, internet explorer is opened with several differnt tabs, ex.(google, yahoo, dogpile)

2
  • 1
    How is writing PowerShell scripts off topic? How is this not a real question? It's asking for scripting advice and is pretty clear, IMO.
    – Sam
    Nov 9 '10 at 4:30
  • 1
    If someone votes to close it, would be good to leave a comment. The question makes sense and is only about writing a script -> belongs here.
    – stej
    Nov 9 '10 at 6:01
6

Tried and worked:

$navOpenInBackgroundTab = 0x1000;
$ie = new-object -com InternetExplorer.Application
$ie.Navigate2("http://blogs.msdn.com");
$ie.Navigate2("http://blogs.msdn.com/tonyschr", $navOpenInBackgroundTab);
$ie.Navigate2("http://blogs.msdn.com/oldnewthing", $navOpenInBackgroundTab);
$ie.Navigate2("http://blogs.msdn.com/ericlippert", $navOpenInBackgroundTab);
$ie.Visible = $true;

Credits go to http://blogs.msdn.com/b/tonyschr/archive/2007/01/19/ie-automation-amp-tabs.aspx

3

Add shortcuts for the URLs you want to load to your Startup menu. No need for a script or PowerShell.

3
  • That would work but I want it all to happen automatically
    – dylan
    Nov 9 '10 at 4:38
  • plus it would open several IE windows not jsut one
    – dylan
    Nov 9 '10 at 4:43
  • 1
    @dylan, by default IE is set to "Reuse windows when launching shortcuts" which will force shortcuts to open in new tabs, like you want. Links in the Startup folder will launch automatically when you log in, like you want.
    – Sam
    Nov 9 '10 at 5:19
2
$ie = new-object -com "InternetExplorer.Application"
ie.show()
$ie.Navigate("google.com",$null,$true)
$ie.Navigate("yahoo.com",$null,$true)
1
  • this only opens 1 tab and when i make the second call to open the second tab it just changes the page to yahoo and doesnt open a second tab. I had made it this far and ran out of ideas. Thanks so much help!!
    – dylan
    Nov 9 '10 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy