搜索已安装的驱动程序:所有属性都为空

时间:2017-06-26 15:10:36

标签: c# driver wmi-query

我想在我的机器上获取所有已安装驱动程序的列表。为此我使用WMI。但由于未知原因,返回的所有属性都有空值(deviceID,DriverVersion和Signer除外)。

到目前为止我尝试和考虑的内容:

使用和不使用管理员权限运行都没有区别

找不到像找到,加载,重新加载找到的任何相关对象的方法

找不到像lazyload

这样的选项 pnputil.exe和driversearch.exe会返回所有驱动程序的数据,但那些输出很难解释

这是C#代码:

        using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver"))
        {
            foreach (ManagementBaseObject u in searcher.Get())
            {
                foreach(PropertyData prop in u.Properties)
                {
                    System.Console.WriteLine($"{prop.Name}={prop.Value}");
                }
                System.Console.WriteLine("===");
            }
        }

找到第一个驱动程序的输出:

Caption=
ClassGuid=
CompatID=
CreationClassName=
Description=
DeviceClass=
DeviceID=\\SVWPSW46\P3115 X WC 7120-D C S U A3
DeviceName=
DevLoader=
DriverDate=
DriverName=
DriverProviderName=
DriverVersion=2:6.0,2:5.2,2:5.1,2:5.0
FriendlyName=
HardWareID=
InfName=
InstallDate=
IsSigned=True
Location=
Manufacturer=
Name=
PDO=
Signer=Microsoft Windows
Started=
StartMode=
Status=
SystemCreationClassName=
SystemName=
===
...

0 个答案:

没有答案
相关问题