Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets or returns the volume name of the specified drive. Read/write.
Syntax
object.VolumeName [= newname]
Arguments
object
Required. Always the name of a Drive object.newname
Optional. If provided, newname is the new name of the specified object.
Remarks
The following code illustrates the use of the VolumeName property:
function SpaceReport(drvPath)
{
var fso, d, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
d = fso.GetDrive(fso.GetDriveName(drvPath));
s = "Drive " + drvPath + " - ";
s += d.VolumeName + "<br>";
s += "Total Space: "+ d.TotalSize/1024 + " Kbytes <br>";
s += "Free Space: " + d.FreeSpace/1024 + " Kbytes";
return(s);
}
Function ShowVolumeInfo(drvpath)
Dim fso, d, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(drvpath)))
s = "Drive " & d.DriveLetter & ": - " & d.VolumeName
ShowVolumeInfo = s
End Function
Applies To:
See Also
AvailableSpace Property
DriveLetter Property
DriveType Property
FileSystem Property
FreeSpace Property
IsReady Property
Path Property (FileSystemObject)
RootFolder Property
SerialNumber Property
ShareName Property
TotalSize Property