How to Set Volume Name for given Drive letter
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 | 'System & API - How to Set Volume Name for given Drive letter Option Explicit Private Declare Function SetVolumeLabelA Lib "kernel32" (ByVal lpRootPathName As String, _ ByVal lpVolumeName As String) As Long Public Function SetVolumeName(ByVal sDriveLetter As String, _ ByVal sNewVolumeName As String) As Boolean Dim I As Long I = SetVolumeLabelA(sDriveLetter & ":\" & Chr$(0), sNewVolumeName & Chr$(0)) SetVolumeName = IIf(I = 0, False, True) End Function |