Manually publishing Internet Explorer 6 for use with Windows XP Mode


For those of you kiddies loving you Windows 7 goodness you may have discovered that from a web development point of view having an Internet Explorer 6 installation without much hassle is a pretty cool thing. Although the fact that you have to launch Windows Xp mode up and can’t use it as a “native” application by launching it from within Windows 7 is a bit of a let down. Let’s fix that :)

Virtual windows xp A bit of background

Most web developers will tell you of the bane on our very existence that is the continuation of internet explorer users in the world. Many different people get around with a version of Multi-IE or something similar so that they can do side by side comparisons. Another tool that seems to be getting traction is Adobe’s Browser Lab.

Windows 7 brings a tool that a lot of people who don’t want to throw away their old software were pining for: Windows XP Mode. This allows you to run a virtual pc copy of Windows XP inside Windows 7 and cross publish applications so that they show up and can be launched from within windows 7 right from the program menu – pretty cool. It relies on some fandangled usage of remote desktop between the two to cover the gaps.

The Windows XP mode image comes with Internet Explorer 6 installed on it by default which makes it a great way to check your sites in IE 6 without living in the dark ages. Sadly this is not published to the program menu of Windows 7 as it would probably make it quite confusing for the average-joe user, so you have to launch the Windows XP VM to access it. We’re going to change that :-)

Simple way

Step 1.

Log into your XP mode machine

Step 2.

Right click on the start button and select “Open all users”

Step 3.

Right click inside the window and create a new shortcut pointing to C:\Program Files\Internet Explorer\iexplore.exe and rename the shortcut Internet Explorer 6


A lit bit of trickery

So i got to looking for a way to publishing applications between the two and found that someone had already solved the problem with this simple vbscript which is based on the original technet article here. I have modified this to automatically publish Internet Explorer 6 from you Windows XP mode installation to Windows 7.

Show me the code!

Simply follow the steps below to make it all happen:

Step 1.

Turn off Auto-Publish in your XP mode VM (Google is your friend)

Step 2.

Copy the following code into notepad in your Windows XP Mode VM and save as C:\PublishIE.vbs (you can name it what you want but just remember where it is so you can replace it in the next step)

strComputer = "."
strNamespace = "\root\cimv2\TerminalServices"
appName = "Internet Explorer 6 XP Mode"
appPath = "C:\Program Files\Internet Explorer\IEXPLORE.exe" 

set x = createobject("Scriptlet.TypeLib")

Set objSWbemServices = GetObject("winmgmts:\\" & strComputer & strNamespace)
Set objSWbemObject = objSWbemServices.Get("Win32_TSPublishedApplication")
Set objNewSWbemObject = objSWbemObject.SpawnInstance_()

objNewSWbemObject.Properties_.Item("Name") = appName  
objNewSWbemObject.Properties_.Item("Alias") = strNewGuid
objNewSWbemObject.Properties_.Item("Path") = appPath
objNewSWbemObject.Properties_.Item("PathExists") = "true"
objNewSWbemObject.Properties_.Item("CommandLineSetting") = "1"
objNewSWbemObject.Properties_.Item("RequiredCommandLine") = ""
objNewSWbemObject.Properties_.Item("IconIndex") = "0"
objNewSWbemObject.Properties_.Item("IconPath") = appPath
objNewSWbemObject.Properties_.Item("VPath") = appPath
objNewSWbemObject.Properties_.Item("ShowInPortal") = "0"

Step 3.

Open an elevated command prompt window and type the following:

cscript C:\PublishIE.vbs

Step 4.

Restart the VM