Полезная информация

Microsoft® JScript™
VolumeName Property
 Language Reference 
Version 3 

See Also                  Applies To

Sets or returns the volume name of the specified drive. Read/write.
object.VolumeName [= newname]

The VolumeName property has these parts:

Part Description
object Required. Always the name of a Drive object.
newname Optional. If provided, newname is the new name of the specified object.

The following code illustrates the use of the VolumeName property:
function SpaceReport(drvPath)
    var fs, d, s;
    fs = new ActiveXObject("Scripting.FileSystemObject");
    d = fs.GetDrive(fs.GetDriveName(drvPath));
    s = "Drive " + drvPath + " - ";
    s += d.VolumeName + "<br>";
    s += "Total Space: "+ d.TotalSize/1024 + " Kbytes <br>";
    s += "Free Space:  " + d.FreeSpace/1024 + " Kbytes";

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.