change drive name

March 19, 2009 by admin  
Filed under Visual Basic

Private Declare Function SetVolumeLabelA Lib “kernel32″ _
(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

Related posts:

  1. Change file extensions Public Function ChangeExtension(ByVal FolderName As String, _ ByVal NewExtension As...
  2. change windows wallpaper Declare Function SystemParametersInfo Lib “user32″ Alias “SystemParametersInfoA” (ByVal uAction As...
  3. Change the windows wallpaper This Visual Basic example will allow you to change the...
  4. change computer name change computer name using Visual Basic Declare Function SetComputerName Lib...
  5. Screen capture Screen capture using Visual Basic Private Declare Sub keybd_event Lib...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!