Click here to Skip to main content
15,867,453 members
Articles / Programming Languages / C++
Article

Determine the version of Internet Explorer installed on a local machine

Rate me:
Please Sign up or sign in to vote.
4.97/5 (11 votes)
18 Nov 20018 min read 225.5K   51   19
Two ways to programmatically determine the version of Internet Explorer installed on a local machine

Introduction

To date, Microsoft has released a total of six major versions of the Internet Explorer browser. But lesser known, is the fact that there are altogether thirty-six different minor versions of Internet Explorer out there in the field. Identifying them programmatically can be a real headache, and especially so for the earlier versions.

Firstly, the version numbers used internally by Microsoft and that as we, the consumers, know it are a world apart (until version 5.5). E.g. Internet Explorer 2.0 carries the version number "4.40.520". I was expecting to see something like "2.0.xxx". Furthermore, the version numbers do not increment in the same manner as that in the product name. E.g. Internet Explorer 3.0 carries the version number "4.70.1155", instead of something like "5.x.x" since version 2.0 starts with a "4.x.x". You will have to use a <a href="#versionsfull">lookup table to match the version numbers against the product names.

Then there is the small matter of retrieving the version number programmatically. Each major version (until version 4.0) of Internet Explorer introduces a different way of identifying the version number from the registry; It first started with the IVer string, then the Build string and finally the Version string.

Microsoft seems to have come to their senses finally. The version numbers now correspond to their marketing counterparts (E.g. Internet Explorer 5.5 carries the version number "5.50.4134.0600"), and we can get the full version string from the Registry using the Version string value.

But if you are still, like me, required to determine versions before Internet Explorer 4.0, then take an aspirin for your headache before going any further.

Disclaimer

This article contains information extracted from MSDN.

Determining the Internet Explorer Version from the Registry

The version number of the installed Internet Explorer can be found under the following registry key:

HKEY_LOCAL_MACHINE\
    Software\
        Microsoft\
            Internet Explorer

Internet Explorer 1.0 for Windows 95 (included with Microsoft Plus! for Windows 95) has an IVer string value under this key, which it sets to "100".

Internet Explorer 2.0 for Windows 95 updates the IVer string value to "102", and adds a Build string value under the same key, which it sets to "520".

Versions of Internet Explorer that are included with Windows NT 4.0 do not add the Build value to the registry, but they do update the IVer string value to "101".

Internet Explorer 3.x modifies the Build string value and updates the IVer string value to "103". Note that the Build value in this version is a string that contains the four-character build number (E.g. "1300" for Internet Explorer 3.02).

For Internet Explorer 4.0 and later, the Build value is a string that contains a five-character value, followed by a period and four more characters, in the following format:

major-version-build-number.sub-build-number

E.g. the Build value for Internet Explorer 5 is "52014.0216."

In addition, it adds a Version string value under the same key, in the following format.

major-version.minor-version.build-number.sub-build-number

E.g. the Version value for Internet Explorer 5 is "5.00.2014.0216".

If none of these values is in the registry, Internet Explorer is not installed properly or at all.

Determining the Internet Explorer Version from Shdocvw.dll

You may use the version number of the Shdocvw.dll (Shell Document Object and Control Library) file to determine the version of Internet Explorer installed. However, note that this approach can only be used on Internet Explorer 3.0 and later since this file does not exist in previous versions of Internet Explorer.

Also, do take note that the version number of this dll is not the same as that stored in the registry. (Although the later versions are starting to have the same numbers.) A table listing the version numbers of the Shdocvw.dll file and the corresponding versions of Internet Explorer may be found here.

The Shdocvw.dll file is installed in the Windows\System folder in Windows 95/98, and in the Winnt\System32 folder in Windows NT/2000. If the Shdocvw.dll file does not exist, Internet Explorer 3.0 or later is not installed properly or at all.

The following WIN32 function retrieves the major version, minor version and build numbers of the Shdocvw.dll that is installed on the local system.

#include "windows.h"
#include "shlwapi.h"

HRESULT GetBrowserVersion(LPDWORD pdwMajor, LPDWORD
        pdwMinor, LPDWORD pdwBuild)
{
    HINSTANCE   hBrowser;

    if(IsBadWritePtr(pdwMajor, sizeof(DWORD))
        || IsBadWritePtr(pdwMinor, sizeof(DWORD))
        || IsBadWritePtr(pdwBuild, sizeof(DWORD)))
        return E_INVALIDARG;

    *pdwMajor = 0;
    *pdwMinor = 0;
    *pdwBuild = 0;

    //Load the DLL.
    hBrowser = LoadLibrary(TEXT("shdocvw.dll"));

    if(hBrowser) 
    {

        HRESULT  hr = S_OK;
        DLLGETVERSIONPROC pDllGetVersion;
        pDllGetVersion =
            (DLLGETVERSIONPROC)GetProcAddress(hBrowser,
                TEXT("DllGetVersion"));

        if(pDllGetVersion) 
        {

            DLLVERSIONINFO    dvi;
            ZeroMemory(&dvi, sizeof(dvi));
            dvi.cbSize = sizeof(dvi);
            hr = (*pDllGetVersion)(&dvi);

            if(SUCCEEDED(hr)) 
            {
                *pdwMajor = dvi.dwMajorVersion;
                *pdwMinor = dvi.dwMinorVersion;
                *pdwBuild = dvi.dwBuildNumber;
            }

        } 
        else 
        {
            //If GetProcAddress failed, there is a problem 
            // with the DLL.

            hr = E_FAIL;
        }
        FreeLibrary(hBrowser);
        return hr;
    }
    return E_FAIL;
}

Internet Explorer version history

The version number of Internet Explorer uses the following format:

major-version.minor-version.build-number.sub-build number

Full listing of Internet Explorer versions

<tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee">

VersionProduct
4.40.308 Internet Explorer 1.0 (Plus!)
4.40.520 Internet Explorer 2.0
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02 and 3.02a
4.71.544 Internet Explorer 4.0 Platform Preview 1.0 (PP1)
4.71.1008.3 Internet Explorer 4.0 Platform Preview 2.0 (PP2)
4.71.1712.6 Internet Explorer 4.0
4.72.2106.8 Internet Explorer 4.01
4.72.3110.8 Internet Explorer 4.01 Service Pack 1 (SP1)
4.72.3612.1713 Internet Explorer 4.01 Service Pack 2 (SP2)
5.00.0518.10 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1309 Internet Explorer 5 Beta (Beta 2)
5.00.2014.0216 Internet Explorer 5
5.00.2314.1003 Internet Explorer 5 (Office 2000)
5.00.2614.3500 Internet Explorer 5 (Windows 98 Second Edition)
5.00.2516.1900 Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2919.800 Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307 Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)
5.00.2920.0000 Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000 Internet Explorer 5.01 SP1 (Windows 2000)
5.00.3105.0106 Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2101 Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.1000 Internet Explorer 5.01 SP2 (Windows 2000)
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100 Windows Me (4.90.3000)
5.50.4134.0600 Internet Explorer 5.5
5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800 Internet Explorer 5.5 Service Pack 1
5.50.4807.2300 Internet Explorer 5.5 Service Pack 2
6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000 Internet Explorer 6

Full listing of Shdocvw.dll versions

<tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee"><tr bgcolor="#eeeeee">

VersionProduct
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02 and 3.02a
4.71.1008.3 Internet Explorer 4.0 PP2
4.71.1712.5 Internet Explorer 4.0
4.72.2106.7 Internet Explorer 4.01
4.72.3110.3 Internet Explorer 4.01 Service Pack 1
4.72.3612.1707 Internet Explorer 4.01 SP2
4.72.3711.2900Internet Explorer 4.x with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.0518.5 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1308Internet Explorer 5 Beta (Beta 2)
5.00.2014.213 Internet Explorer 5
5.00.2314.1000Internet Explorer 5 (Office 2000)
5.00.2516.1900 Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2614.3500Internet Explorer 5 (Windows 98 Second Edition)
5.00.2717.2000 Internet Explorer 5 with Update for "Malformed Favorites Icon" Security Issue installed.
5.00.2721.1400Internet Explorer 5 with Update for "ImportExport Favorites()" Security Issue installed.
5.00.2723.2900 Internet Explorer 5.0 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2919.800 Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800 Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)
5.00.2919.6400 Internet Explorer 5.01 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2920.0000Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000 Internet Explorer 5.01 SP1 (Windows 2000)
5.00.3105.0106Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2100 Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.2879Internet Explorer 5.01 SP2 (Windows 2000)
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100 Windows Me (4.90.3000)
5.50.4134.0600Internet Explorer 5.5
5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800Internet Explorer 5.5 Service Pack 1
5.50.4807.2300 Internet Explorer 5.5 Service Pack 2
6.00.2462.0000Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000Internet Explorer 6

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Singapore Singapore
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Question.NET has provided a way of determining this since 2.0 Pin
Tom Clement29-Oct-13 8:01
professionalTom Clement29-Oct-13 8:01 
GeneralMy vote of 5 Pin
Member 835844820-Jan-12 14:46
Member 835844820-Jan-12 14:46 
GeneralRe: My vote of 5 Pin
Member 827172223-Jan-13 2:12
Member 827172223-Jan-13 2:12 
QuestionInstalling earlier version of Explorer Pin
Susoyev25-Nov-06 20:38
Susoyev25-Nov-06 20:38 
AnswerRe: Installing earlier version of Explorer Pin
Dean Wyant5-Dec-06 11:02
Dean Wyant5-Dec-06 11:02 
GeneralRe: Installing earlier version of Explorer Pin
pankaj hedau13-Sep-10 21:13
pankaj hedau13-Sep-10 21:13 
GeneralYet another way Pin
David Crow1-Jul-03 2:59
David Crow1-Jul-03 2:59 
GeneralShlwapi.h Pin
charliedurrant17-Mar-03 4:51
charliedurrant17-Mar-03 4:51 
QuestionHow do u get all the version number? Pin
Anonymous27-Dec-02 17:26
Anonymous27-Dec-02 17:26 
How do u get all the different version number? Is there a site that list them or MS have a site that list all the version number?
AnswerRe: How do u get all the version number? Pin
JoeSox27-Dec-02 17:46
JoeSox27-Dec-02 17:46 
AnswerRe: How do u get all the version number? Pin
JohnJ28-Dec-02 1:10
JohnJ28-Dec-02 1:10 
AnswerRe: How do u get all the version number? Pin
Aaron Jeskey10-Feb-05 7:56
sussAaron Jeskey10-Feb-05 7:56 
AnswerRe: How do u get all the version number? Pin
Nikhil Khade9-Nov-05 19:25
Nikhil Khade9-Nov-05 19:25 
GeneralRe: How do u get all the version number? Pin
JanLund19675-Jul-07 20:05
JanLund19675-Jul-07 20:05 
GeneralAddition and questions Pin
JanLund196719-Nov-02 0:14
JanLund196719-Nov-02 0:14 
GeneralGood work! Pin
Nish Nishant23-Nov-01 17:52
sitebuilderNish Nishant23-Nov-01 17:52 
GeneralIf you just need mayor and minor version... Pin
Thomas Freudenberg18-Nov-01 22:32
Thomas Freudenberg18-Nov-01 22:32 
GeneralDetecting Netscape's version Pin
Sidney Chong18-Nov-01 22:17
Sidney Chong18-Nov-01 22:17 
GeneralRe: Detecting Netscape's version Pin
S van Leent11-May-02 11:06
S van Leent11-May-02 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.