VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Change the name of a disk drive

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

Rate Change the name of a disk drive



'
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

Download this snippet    Add to My Saved Code

Change the name of a disk drive Comments

No comments have been posted about Change the name of a disk drive. Why not be the first to post a comment about Change the name of a disk drive.

Post your comment

Subject:
Message:
0/1000 characters