Ich habe zwar eine Lösung, allerdings ist die Lösung irgendwie auf C:\ begrenzt.
Form:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
'
'*** Daten ermitteln ***
'
Dim lResult As Long
lResult = SetVolumeLabel(Left$(Drive1.Drive, 2) + "\", Test)
Drive1.Refresh
End Sub
Modul:
Option Explicit
'Hier alle benötigten API-Funktionen
Declare Function SetVolumeLabel Lib "kernel32" Alias "SetVolumeLabelA" (ByVal lpRootPathName As String, ByVal lpVolumeName As String) As Long