mapping partitions starting from PhysicalDrive

后端 未结 3 1231
慢半拍i
慢半拍i 2021-01-17 03:11

I want to map all partitions from all drives in Windows (the ones who are not mapped already). I mean I want to assign to each of them drive letters. I know that you can do

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 03:49

    You can do This using WMI.
    In library GLibWMI (http://neftali.clubdelphi.com or SourceForge) you can find the TDiskPartitionInfo and TDiskDriveInfo.
    The first can give you the created partitions and all of your properties.
    Test the Generic Sample and check the results. In an partitioned disk like this:
    alt text

    You obtains 4 instantes with the properties of 4 partitions like this:

    alt text

    The library it's totally free and source is avaible. Check the samples.
    You can find some other codes to access this information using WMI. If you want use another, you can search for "WMI and Win32_DiskPartition Class" (Link doc).

    Excuse-me for mistakes with English.
    Regards

提交回复
热议问题