title: How can I determine the version of a device driver when the device is not plugged in?
body: <p>Thanks to some other helpful StackOverflow questions, I've found a way to query WMI for device drivers. However, it seems to me that the data is being stored in disparate places that don't join together well.</p>
  
  <p>I have a USB-to-serial port cable using FTDI drivers. I can query <code>Win32_SystemDrivers</code> to determine whether or not the drivers have been installed, like this:</p>
  
  <pre><code>SelectQuery query = new SelectQuery("Win32_SystemDriver");
  query.Condition = "Name = 'FTDIBUS'";
  
  ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
  ManagementObjectCollection drivers = searcher.Get();
  bool installed = (drivers.Count &gt; 0);
  </code></pre>
  
  <p>But that collection doesn't tell me a thing about version information. So then I discovered I could query <code>Win32_PnPSignedDriver</code> to find the version of the device driver. So I'm doing something like this:</p>
  
  <pre><code>SelectQuery query = new SelectQuery("Win32_PnPSignedDriver");
  query.Condition = "DriverProviderName = 'FTDI'";
  
  ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
  ManagementObjectCollection drivers = searcher.Get();
  
  foreach (ManagementBaseObject driverObject in drivers)
  {
      ManagementObject driver = (ManagementObject)driverObject;
      string version = driver["DriverVersion"].ToString();
  }
  </code></pre>
  
  <p>However, that second block of code will only succeed if the cable (device) is actually plugged in. What I'd like to do is to check the version of the installed device driver, regardless of whether or not the device is currently plugged in.</p>
  
  <p>How do I do this?</p>