This C# Code claims that the DiskDrive and PhysicalMedia occur in order, so that the serial number in the latter can be related to the drive in the former. In my case, it didn't matter as I had only the one disk drive. However, if you have more than one, that's what the foreach/in is for. For a complete list of the methods, see: Hope this gets you further to what you want -jim Update link was to C# code, not VB code.use Win32::OLE qw( in); #-- get an object reference to the manager my $local_computer = "."; my $mgmr = Win32::OLE->GetObject("winmgmts://./root/cimv2"); print "A sample of methods from\n"; print "\t'http://msdn.microsoft.com/library/default.asp?url=/library/e +n-us/wmisdk/wmi/win32_diskdrive.asp'\n"; print "\n"; foreach my $objDisk (in $mgmr->InstancesOf("Win32_DiskDrive")) { print "Availability\t", $objDisk->Availability, "\n"; print "Bytes per Sector\t", $objDisk->BytesPerSector, "\n"; print "Caption\t", $objDisk->Caption, "\n"; print "Compression Method\t", $objDisk->CompressionMethod, "\n"; print "Creation Class Name\t", $objDisk->CreationClassName, "\n" +; print "Default Block Size\t", $objDisk->DefaultBlockSize, "\n"; print "Description\t", $objDisk->Description, "\n"; print "Device ID\t", $objDisk->DeviceID, "\n"; print "Install Date\t", $objDisk->InstallDate, "\n"; print "Manufacturer\t", $objDisk->Manufacturer, "\n"; print "Media Type\t", $objDisk->MediaType, "\n"; print "Model\t", $objDisk->Model, "\n"; print "Name\t", $objDisk->Name, "\n"; print "Needs Cleaning\t", $objDisk->NeedsCleaning, "\n"; print "Partitions\t", $objDisk->Partitions, "\n"; print "PnP Device ID\t", $objDisk->PNPDeviceID, "\n"; print "Signature\t", $objDisk->Signature, "\n"; print "Size\t", $objDisk->Size, "\n"; print "System Name\t", $objDisk->SystemName, "\n"; print "\n"; } print "A sample of methods from\n"; print "\t'http://msdn.microsoft.com/library/default.asp?url=/library/e +n-us/wmisdk/wmi/win32_physicalmedia.asp'\n"; print "\n"; foreach my $objDisk (in $mgmr->InstancesOf("Win32_PhysicalMedia")) { print "Capacity\t", $objDisk->Capacity, "\n"; print "Caption\t", $objDisk->Caption, "\n"; print "Creation Class\t", $objDisk->CreationClassName, "\n"; print "Description\t", $objDisk->Description, "\n"; print "Manufacturer\t", $objDisk->Manufacturer, "\n"; print "Media Description\t", $objDisk->MediaDescription, "\n"; print "Media Type\t", $objDisk->MediaType, "\n"; print "Model\t", $objDisk->Model, "\n"; print "Name\t", $objDisk->Name, "\n"; print "Other ID Info\t", $objDisk->OtherIdentifyingInfo, "\n"; print "Part Number\t", $objDisk->PartNumber, "\n"; print "Serial Number\t", $objDisk->SerialNumber, "\n"; print "SKU\t", $objDisk->SKU, "\n"; print "Status\t", $objDisk->Status, "\n"; print "Write Protect\t", $objDisk->WriteProtectOn, "\n"; print "\n"; }
In reply to Re^3: Getting Hardware Keys from Windows
by jimbojones
in thread Getting Hardware Keys from Windows
by PerlingTheUK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |