title: Python WMI - can we really say that 'C:' is always the boot drive?
body: <p>I am working on a task to find the boot drive among list of SSDs connected.
  Trying to get it by matching device path("\\.\PHYSICALDRIVE0") of drives with logical disk partition using WMI.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import wmi
  w = wmi.WMI()
  
  for physical_disk in w.Win32_DiskDrive():
       if physical_disk.DeviceID == "\\.\PHYSICALDRIVE0":
             for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
                          for logical in partition.associators("Win32_LogicalDiskToPartition"):
                              if logical.caption == 'C:':
                                 print "Its a boot drive"
                                 break
  </code></pre>
  
  <p>I feel like just checking if we are looking at the c-drive is not quite enough. I feel like this can go wrong... Are we assured that 'C:' is always the boot drive? It probably is most of the time, but can we really say that 'C:' is always the boot drive?</p>
  
  <p>Can we have a more robust way to ensure the drive we are looking at is a boot drive?</p>