Kedar Joshi
Kedar Joshi

Reputation: 1

Read Installed Device Driver Details (version, install date, path etc), on Win system

Can anyone help please in this regard ? What API's can be used from win32 to get installed device drivers details like version, installation date, path where installed ?

Regards, Kedar

Upvotes: 0

Views: 4009

Answers (3)

Hans Passant
Hans Passant

Reputation: 941218

The best way is WMI, .NET supports it well with the System.Management namespace. You'll want to use the Win32_SystemDriver WMI class. I copied and pasted this code from WMICodeCreator, a great tool to experiment and auto-generate the code you need:

using System;
using System.Management;  // Project + Add Reference required

public class MyWMIQuery {
  public static void Main() {
    ManagementObjectSearcher searcher =
        new ManagementObjectSearcher("root\\CIMV2",
        "SELECT * FROM Win32_SystemDriver");

    foreach (ManagementObject queryObj in searcher.Get()) {
      Console.WriteLine("Driver caption: {0}", queryObj["Caption"]);
    }
    Console.ReadLine();
  }
}

Check out the links I left in this post, Win32_SystemDriver has many other properties beyond "Caption".

Upvotes: 3

On Freund
On Freund

Reputation: 4436

You need to consult the Setup API function for driver information.

Upvotes: 0

Related Questions