You actually need to use the Win32_PhysicalMedia class to get a drive serial number, which is what I assume you mean from that vague description:
VB Code:
Dim physicalMedia As New Management.ManagementClass("Win32_PhysicalMedia")
For Each physicalMedium As Management.ManagementObject In physicalMedia.GetInstances()
MessageBox.Show("Serial Number: " & CStr(physicalMedium("SerialNumber")))
Next physicalMedium
Note that this will give you the serial number for the physical medium for every drive in your machine, which will be nothing for most of them. You acnnot easily identify which one is which without using the Win32_DiskDrive and Win32_DiskDrivePhysicalMedia classes as well. I have done this myself recently, and I found that the best way was to use the mgmtclassgen.exe utility to generate .NET classes that correspond to the WMI classes and then use code like this:
VB Code:
Dim driveMedia As New ManagementClass("Win32_DiskDrivePhysicalMedia")
Dim driveMedium As DiskDrivePhysicalMedia
Dim drive As DiskDrive
Dim medium As PhysicalMedia
Dim interfaceType As String
Dim serialNumber As String
'Look for the first hard disk serial number.
For Each mo As ManagementObject In driveMedia.GetInstances()
driveMedium = New DiskDrivePhysicalMedia(mo)
drive = New DiskDrive(driveMedium.Dependent)
medium = New PhysicalMedia(driveMedium.Antecedent)
interfaceType = drive.InterfaceType
serialNumber = medium.SerialNumber
drive.Dispose()
medium.Dispose()
mo.Dispose()
If (interfaceType = "IDE" OrElse interfaceType = "SCSI") AndAlso _
serialNumber <> Nothing Then
driveMedia.Dispose()
Return serialNumber
End If
Next mo
driveMedia.Dispose()
The DiskDrivePhysicalMedia, DiskDrive and PhysicalMedia classes are the ones generated by the utility. Do a help search for the name and you'll find a topic that tells you how to use it.