windows 如何检测安装了哪个版本的 Internet Explorer?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3553984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I detect which version of Internet Explorer is installed?
提问by Maltrap
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?
在 Windows 注册表的卸载键下查看的最佳方法是什么?是否有提供此信息的 Microsoft API 调用,是否从 XP 开始支持?
What is the best way to detect which version of Internet Explorer is installed on the local machine?
检测本地计算机上安装了哪个版本的 Internet Explorer 的最佳方法是什么?
回答by Andrea Parodi
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
.
您必须查看注册表,而不是卸载键。相反,找到键 atHKLM\Software\Microsoft\Internet Explorer
并读取名为 的值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.
对于较新的版本(IE 10 及更高版本),Version
是 9.x(例如,IE 10 是 9.10.something),新svcVersion
值给出了真实的 IE 版本。
This technique is even recommended by Microsoft; see here.
微软甚至推荐了这种技术;看到这里。
回答by Dubas
If you require to know the IE version into a web application you can get the User-Agent or use javascript:
如果您需要在 Web 应用程序中了解 IE 版本,您可以获取 User-Agent 或使用 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
您在此处获得了有关如何获取 Internet Explorer 版本的 Microsoft 示例 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
如果您需要将 IE 版本检测到 X 语言的桌面程序中,您需要阅读 Windows 注册表
This registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
contains the attribute Version
with the IE version
此注册表项HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
包含Version
IE 版本的属性
回答by user3429268
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.
Version 值似乎不包括您最可能需要的 Internet Explorer 版本信息。相反,查看 svcVersion 或 svcUpdateVersion 以获取信息。
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.
例如,我正在运行 IE 10,如果我查询 Version 注册表值 9.10.9200.16798 返回,但如果我查询 svcUpdateVersion 10.0.13 返回。后者对应于实际的 Internet Explorer 版本 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 版本 HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer 版本 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 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
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v svcVersion HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer svcVersion REG_SZ 10.0.9200.16798
回答by Ohad Schneider
I'd like to challenge the conventional wisdom of inspecting the registry. Consider the reference source for System.Windows.Forms.WebView.Version:
我想挑战检查注册表的传统智慧。考虑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.
据推测,编写WebView
类的人知道他们在做什么。
回答by Lyman Lee
You can also know the IE version on multiple computers using this script:
您还可以使用此脚本了解多台计算机上的 IE 版本:
@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.
在文件: 中ListaEquipos.txt
,有一个计算机列表。
It is also necessary to check RemoteRegistry
service enabled on the target computers.
还需要检查RemoteRegistry
目标计算机上启用的服务。
Extracted from: http://www.sysadmit.com/2017/08/windows-buscar-version-de-internet-explorer-en-equipo-remoto.html
摘自:http: //www.sysadmit.com/2017/08/windows-buscar-version-de-internet-explorer-en-equipo-remoto.html