Private Declare Function SetVolumeLabel Lib "kernel32" Alias
"SetVolumeLabelA" _ (ByVal lpRootPathName As String, ByVal lpVolumeName As String) As Long
Private Sub Command1_Click()
If SetVolumeLabel("d:\", "MyNewLabel") = 0 Then
MsgBox "An Error occured while trying to change drive label", vbCritical, "Error"
End If
End Sub |
|