Hey, Scripting Guy! How can I determine which version of Internet Explorer is installed on a computer?
— MG
Hey, MG. Probably the best (and definitely the easiest) way to do this is to use WMI; after all, using WMI makes it as easy to get this information from remote computers as it is to get it from the local machine. Here’s a sample script that returns version information for Internet Explorer and – as an added bonus – returns the Product ID and the encryption level of Internet Explorer as well:
strComputer = “.” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & _ “\root\cimv2\Applications\MicrosoftIE”)Set colIESettings = objWMIService.ExecQuery _ (“Select * from MicrosoftIE_Summary”)
For Each strIESetting in colIESettings Wscript.Echo “Version: ” & strIESetting.Version Wscript.Echo “Product ID: ” & strIESetting.ProductID Wscript.Echo “Cipher strength: ” & strIESetting.CipherStrength Next
For the most part this is just a regular old WMI script; the only tricky part lies in connecting to the WMI service. That’s because the class we need to work with – MicrosoftIE_Summary – happens to live in the root\cimv2\Applications\MicrosoftIE namespace. Make sure you spell that out completely; if you specify the root\cimv2 namespace (which is standard for most WMI scripts) the script will fail with a “Class not found” error.
Beyond that we simply query the MicrosoftIE_Summary class and echo back values for the Version, ProductID, and CipherStrength properties.
Although not well-known and hardly publicized, the root\cimv2\Applications\MicrosoftIE namespace dates back to at least Internet Explorer 5.00.2920.0000, which happens to be the version of Internet Explorer that shipped with Windows 2000. If you’re interested in other Internet Explorer values that can be retrieved using the classes found in this namespace, check out the scripts found in this section of the Script Center Script Repository. NOTE: begining with Windows Vista this WMI namespace has been removed.
0 comments