Internet Explorer Tab Sets and Windows Scripting Host
Launch IE with your Favorite Groups of Sites
In another article I discussed a commonly used trick that lets you navigate directly to certain Dynamics CRM windows, and showed how to combine that with IE tab sets to build an efficient, dashboard-style user experience for Dynamics CRM.
In that article I used my organization’s Dynamics CRM Online to illustrate. The technique is identical whether you’re using CRM Online or on-premise, but it might be more useful in Dynamics CRM Online, because more functionality is exposed through this direct navigation technique. For example, the November 2009 Service Update added the sweet new home-page dashboard with customizable charts, so I now use a URL like this one — https://imginc.crm.dynamics.com/Home/Homepage/TTV_Home.aspx — to navigate directly to a page like this one:

When you’ve got a hammer…
…everything looks like a nail, right? So of course, I created a bunch of tab sets for the various groupings of web sites I tend to go to on a regular basis. A few minutes later, I’d created four tab sets (which are really just IE favorites folders), with four or five sites in each. This was a useful exercise, as it made me think about how the different web sites I use work together to support the activities I’m doing. Here’s a shot of what my favorites folders/tab sets look like, with a summary of how to use them:

Use Windows Script Host to open in different IE Windows
As soon as I started using them, however, the tabs quickly got out of hand. For example, if I open my Dynamics CRM tab set that’s four tabs, then I open my blogs and add six more tabs…and it’s just as easy to lose track of things as ever.
What I really needed was to launch IE and have it open a single tab set in a separate window. After hunting around a little bit, I found this nice summary of how to use COM automation to do this, using the Windows Scripting Host to automate Internet Explorer: http://blogs.msdn.com/tonyschr/archive/2007/01/19/ie-automation-amp-tabs.aspx
I’ve never done much with Windows Scripting, but it was exactly what I needed to solve this problem. If you run wscript.exe from the command line it doesn’t really do anything; the key is to provide a .js file as a command line argument. Here’s the file I created (copying Tony’s example from the article above) that opens up all of the pages in my Dynamics CRM dashboard, each on a different tab in the same window. The following script is in a text file I called “crmsites.js”:
var navOpenInBackgroundTab = 0×1000;
var oIE = new ActiveXObject(“InternetExplorer.Application”);
oIE.Navigate2(“https://imginc.crm.dynamics.com/loader.aspx”);
oIE.Navigate2(“https://imginc.crm.dynamics.com/Home/Homepage/TTV_Home.aspx#”, navOpenInBackgroundTab);
oIE.Navigate2(“https://internetleadcapture.dynamics.com/Home/Dashboard.aspx?dl1prm=%3fuflcid%3den-US%26DLExternalIdValue%3dhttp%3a%2f%2fimginc.crm.dynamics.com&wa=wsignin1.0″, navOpenInBackgroundTab);
oIE.Visible = true;
I thought this was pretty cool, anyway. The variable oIE points to an instance of IE, and you just make calls to the “Navigate2″ method, passing in the URLs you want to open on the tabs. Then set the Visible property to “true”.
So how do you run an application like that? I wanted shortcuts from my desktop, so I started off by creating a shortcut to run wscript.exe:
- Right-click your desktop, click New, then Shortcut.
- Enter “wscript.exe” in the Type the location of the item box, click Next, then Finish.
- Right-click the new shortcut (it should have the Windows Scripting icon attached to automatically) and click Properties. It should look like this:

Notice that in mine the “Start in” parameter is “windir” – this is the folder where Windows sits; conventionally that’s c:\Windows, so that’s where the Windows Scripting Host will look for parameters by default. So as long as I save my crmsites.js file into the c:\Windows folder, all I need to do is supply the file name in the Target field, like this:

So finally, after making copies of the js file, substituting in the right URLs and creating wscript.exe shortcuts pointing to each one, I can just double-click any of my shortcuts and open up a new IE window with each page on its own tab.
For example, I double-click “My fave blogs”:

And in a few seconds, the six blogs with which I start my Dynamics CRM day all show up in one window:



















Brought to you by Richard Knudson and IMG.