Erfahren Sie etwas über ein bestimmtes Laufwerk...
Option Explicit
Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
"GetVolumeInformationA" (ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
Private Sub Form_Load()
Dim VolumeNameBuffer As String
Dim FileSystemNameBuffer As String
Dim myDrive As String
Dim VolumeSerialNumber As Long
Dim MaximumComponentLength As Long
Dim FileSystemFlags As Long
myDrive = "C:\" ' bei Bedarf ändern
VolumeNameBuffer = Space(40)
FileSystemNameBuffer = Space(20)
GetVolumeInformation Left(myDrive, 1) & ":\", VolumeNameBuffer, Len(VolumeNameBuffer), _
VolumeSerialNumber, MaximumComponentLength, FileSystemFlags, _
FileSystemNameBuffer, Len(FileSystemNameBuffer)
Label1.Caption = FileSystemNameBuffer
Label2.Caption = VolumeNameBuffer
Label3.Caption = CStr(VolumeSerialNumber)
End Sub