I tried looking at Win32::DriveInfo and that did not have all the information I needed. The Serial Number listed there is volume S/N, not physical S/N. I checked out that other link, but I had NO idea how to implement it in Perl.
I did some digging on WMI in the MSDN and found what I need, but it isn't pretty.
Drive letter info is given at the Win32_LogicalDisk level. The tree from there is as follows:
Win32_LogicalDiskToPartition links to
Win32_DiskPartition, which is referenced by
Win32_DiskDriveToDiskPartition, which links to
Win32_DiskDrive, which is referenced by
Win32_DiskDrivePhysicalMedia, which links to
Win32_PhysicalMedia, which has the actual hardware S/N.
Whew! :) So that ain't gonna be pretty, but all the data is there.
I also saw that newer versions of windows have access to the Win_32_Volume class, which links drive letter to a weird volume string (which looks like a registry entry). However, I could not find how that maps to a physical device, which is the only way, apparently, to get the HW S/N.
Thanks for the help so far. If anyone has any more advice on shortcuts or different approaches, I'm all ears. Until then, I will plug away at this. --Anthony
| [reply] |