Pre Windows Vista, you could find the version of Internet Explorer via WMI using the following method:
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
The MicrosoftIE_Summary object does not exist post Windows XP though (Why Microsoft, why?), so to find your browser versions, you could use the following VB Script, which essentially just checks the file version for you.
'Find the Firefox version (64 Bit machines with 32-bit Firefox installed) Set objFSO = CreateObject("Scripting.FileSystemObject") file = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" Wscript.Echo objFSO.GetFileVersion(file) 'Find the Firefox version (Normal 32-bit machine) Set objFSO = CreateObject("Scripting.FileSystemObject") file = "C:\Program Files\Mozilla Firefox\firefox.exe" Wscript.Echo objFSO.GetFileVersion(file) 'IE Version file = "C:\Program Files\Internet Explorer\iexplore.exe" Wscript.Echo objFSO.GetFileVersion(file)
Irrespective of whether you are running XP, Vista, 7 or even a Server variety of Windows, I would recommend the latter way of doing it though. You will probably have to build in some checks to see which browsers are installed before checking their versions. I see a lot of ‘if’ and ‘else if’s’ coming here 🙂