您如何获得 Windows 视频驱动程序的版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/404146/
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 you get the version of the Windows video driver(s)?
提问by Die in Sente
On Windows, how can my user-mode program get the driver version number(s) for the video card(s) installed?
在 Windows 上,我的用户模式程序如何获取已安装显卡的驱动程序版本号?
Programs like ATI's "Catalyst Control Center" can display this information to the user or include it automatically into bug reports. How do they get it?
像 ATI 的“催化剂控制中心”这样的程序可以向用户显示此信息或将其自动包含在错误报告中。他们是怎么得到的?
I've been looking thru the PSDK documentation, and I can't find anything relevant.
我一直在查看 PSDK 文档,但找不到任何相关内容。
Can a user program walk thru the database that Device Manager displays?
Is there an IOCTL call like getting disk drive geometry?
Is it in a (reliable) registry key?
用户程序能否遍历设备管理器显示的数据库?
是否有类似获取磁盘驱动器几何形状的 IOCTL 调用?
它是否在(可靠的)注册表项中?
回答by JasonTrue
In PowerShell:
在 PowerShell 中:
Get-WmiObject Win32_VideoController | format-table Name, Description,VideoProcessor,DriverVersion
The WMI objects are also available from any language that speaks COM or .Net.
WMI 对象也可从任何使用 COM 或 .Net 的语言中获得。
ETA: You may wish to exclude records without a value for VideoProcessor, like the Live Mesh drivers. I did that by including |where {$_.VideoProcessor -ne $null }
in the pipeline before the format command.
ETA:您可能希望排除没有 VideoProcessor 值的记录,例如 Live Mesh 驱动程序。我通过|where {$_.VideoProcessor -ne $null }
在格式命令之前将其包含在管道中来做到这一点。
回答by Wang Dingwei
I used "dxdiag /x output.xml", then get the video driver version by parsing "output.xml". dxdiag is slow, but it tells the one correct driver version..
我使用了“dxdiag /x output.xml”,然后通过解析“output.xml”来获取视频驱动程序版本。dxdiag 很慢,但它告诉一个正确的驱动程序版本..
I used python to do this job. Inspired by Jason's answer, I get the following code:
我使用 python 来完成这项工作。受杰森回答的启发,我得到以下代码:
>>> import wmi
>>> c = wmi.WMI()
>>> for device in c.Win32_VideoController():
if device.VideoProcessor:
print device.DriverVersion
回答by BobbyShaftoe
I've had to solve this problem before. I believe you actually have to get the File Version information of the associated driver file.
我以前不得不解决这个问题。我相信您实际上必须获取相关驱动程序文件的文件版本信息。