Search code examples
c++internet-explorerprocess

How can I find programatically where iexplore.exe is?


I need to run myApp.exe that in turn will launch iexplore.exe. What is the most robust, generic way (OS bit version agnostic) to do so?

Can you point me to the right registry key /env var/other mean to do so?

Thanks, Guy


Solution

  • For newer versions of Internet Explorer you can check the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities\ApplicationDescription.

    That being said, the most backward- and forward-compatible way will be to look in the following paths (in this order):

    In Registry: HKEY_CLASSES_ROOT\IE.AssocFile.HTM\shell\open\command %ProgramFiles(x86)%\Internet Explorer\iexplore.exe %ProgramFiles%\Internet Explorer\iexplore.exe

    Note that 64-bit Windows versions may have two different versions of IE: 32-bit and 64-bit. At least as things are now (with IE9), you'd usually want to use the 32-bit version, since it's better optimized and has better plugin/ActiveX compatibility.