Search code examples
c#wmidiskpartitionserial-number

How can i get Partition Serial/ID/Signature?


I want to know the identifier for a partition when checking the disk. It's needed for logging, for instance: If on my computer drive C: is 041d when i plug it to a different computer it will get a different driveletter(D:) but the partition is the same 041d.

How can i get it?

P.S - Not talking about the VolumeSerialNumber that is for the Disk itself, but i'm referring to PartitionSerialNumber(if there is such a thing).


Solution

  • This issue was solved using the Index property of the partition. Partition Index number is permanent. Win32_DiskPartition