' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Management

Public Class MainClass
    Public Shared Sub Main(ByVal args As String())
        Dim objectQuery As WqlObjectQuery = New WqlObjectQuery("SELECT * FROM Win32_LogicalDisk")
        Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(objectQuery)
        For Each p As ManagementObject In searcher.Get
            Console.WriteLine("Caption = " & p("Caption"))
            Console.WriteLine("DriveType = " & Convert.ToString(p("DriveType")))
            Console.WriteLine("FileSystem = " & p("FileSystem"))
            Console.WriteLine("MediaType = " & Convert.ToString(p("MediaType")))
            Console.WriteLine("Size = " & Convert.ToString(p("Size")))
            Console.WriteLine("VolumeName = " & p("VolumeName"))
        Next
    End Sub
End Class 
