Is the best way to look under the Uninstall key of the Windows Registry? Is there a Microsoft API call which provides this info and is it supported from XP onwards?
You have to look in the registry, but not in uninstall key. Instead,
find the key at HKLM\Software\Microsoft\Internet Explorer
and read the value named Version
.
For newer versions (IE 10 and above), Version
is 9.x (for example, IE 10 is 9.10.something), and the new svcVersion
value gives the true IE version.
This technique is even recommended by Microsoft; see here.
If you require to know the IE version into a web application you can get the User-Agent or use javascript:
You got here a Microsoft sample of how to get the internet Explorer version http://msdn.microsoft.com/en-us/library/ms537509(VS.85).aspx
If you require to detect the IE Version into a Desktop program with X language you need to read the Windows registry
This registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
contains the attribute Version
with the IE version
You can also know the IE version on multiple computers using this script:
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=C:\SYSADMIT\ListaEquipos.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
)
Inside the file: ListaEquipos.txt
, there is a list of computers.
It is also necessary to check RemoteRegistry
service enabled on the target computers.
Extracted from: http://www.sysadmit.com/2017/08/windows-buscar-version-de-internet-explorer-en-equipo-remoto.html
The Version value doesn't seem to include the Internet Explorer version information that you would most likely need. Instead, look at either svcVersion or svcUpdateVersion for the information.
As an example, I am running IE 10 and if I query the Version registry value 9.10.9200.16798 is returned but if I query svcUpdateVersion 10.0.13 is returned. The latter corresponds to the actual Internet Explorer version which is 10.
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v Version HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer Version REG_SZ 9.10.9200.16798
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v svcUpdateVersion HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer svcUpdateVersion REG_SZ 10.0.13
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v svcVersion HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer svcVersion REG_SZ 10.0.9200.16798
I'd like to challenge the conventional wisdom of inspecting the registry. Consider the reference source for System.Windows.Forms.WebView.Version:
string mshtmlPath =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
FileVersionInfofvi = FileVersionInfo.GetVersionInfo(mshtmlPath);
return new Version(
fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart, fvi.FilePrivatePart);
Presumably, the guys who wrote the WebView
class knew what they were doing.