Table of contents
Collapse the table of content
Expand the table of content

VolumeName Property

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Description Sets or returns the volume name of the specified drive. Read/write. Syntaxobject. VolumeName [= newname ] The VolumeName property has these parts:

objectRequired. Always the name of a Drive object.
newnameOptional. If provided, newname is the new name of the specified object.

Remarks The following code illustrates the use of the VolumeName property:

Sub ShowVolumeInfo(drvpath)
    Dim fs, d, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
    s = "Drive " &; d.DriveLetter &; ": - " &; d.VolumeName
    MsgBox s
End Sub
© 2018 Microsoft