Get Disk Number from Drive Letter

  • Thread starter Thread starter wingers
  • Start date Start date
W

wingers

Guest
Hi

Can anyone tell me a way in VB to get Disk Number if I supply Drive Letter

As you can see from screenshot below which is output from DiskPart it shows both disks (list disk) and volumes (list volume)

1479203.png

I need a way to find which disk contains a supplied drive letter e.g. C: is on Disk 2

I can see this information in Disk Management, but I want to be able to automate it in VB so I simply run a function or sub supplying C: and it returns Disk 2 - if it also returned Partition number as well that would be good but not a necessity

Thanks for reading




Darren Rose

Continue reading...
 
Back
Top