by Anonymous (267 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sun 2nd May 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Change the name of a disk drive
API Declarations
(ByVal lpRootPathName As String, _
ByVal lpVolumeName As String) As Long
'
Public Function SetVolumeName(sDrive As String, n As String) As Boolean
Dim i As Long
i = SetVolumeLabelA(sDrive + ":\" & Chr$(0), n & Chr$(0))
SetVolumeName = IIf(i = 0, False, True)
End Function