Gets the names of all the partitions in a system. Note that media must be in every removable drive for this to work (can be fixed easily)
Get HD Info
' GetHDInfo - Get names of all the partitions and drives on a system
Dim FSO, d, Drives, MyStr, n
' Create the FileSystemObject
Set FSO = CreateObject("Scripting.FileSystemObject")
' Get the list of drives
Set Drives = FSO.Drives
' Go through the drives and get names
For Each d In Drives
MyStr = MyStr & d.DriveLetter & " - "
If d.DriveType = 3 Then
n = d.ShareName
Else
n = d.VolumeName
End If
MyStr = MyStr & n & vbCrLf
Next
MsgBox MyStr
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.