Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW To get Hard disk Volume serial label?

Status
Not open for further replies.

RezaNana

Programmer
Dec 18, 2002
80
MY
I'm looking for a code that can display hard disk volume serial label of the computer hard disk.I've seen it done before but forget how!
 
A starting point:
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
n = ""
s = s & d.DriveLetter & " - "
If d.DriveType = Remote Then
n = d.ShareName
ElseIf d.IsReady Then
n = d.VolumeName & " SN:" & Left(Hex(d.SerialNumber),4) & "-" & Right(Hex(d.SerialNumber),4)
End If
s = s & n & vbCrLf
Next
MsgBox s

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top