Microsoft® JScript™
TotalSize Property
 Language Reference 
Version 3 

See Also                  Applies To


Description
Returns the total space, in bytes, of a drive or network share.
Syntax
object.TotalSize

The object is always a Drive object.

Remarks
The following code illustrates the use of the TotalSize property:
function ShowSpaceInfo(drvpath)
{
    var fs, d, s;
    fs = new ActiveXObject("Scripting.FileSystemObject");
    d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)));
    s = "Drive " + d.DriveLetter + ":" + "\n";
    s += "Total Size: " + d.TotalSize/1024 + " Kbytes";
    s += "\n" + "Available: " + d.AvailableSpace/1024 + " Kbytes";
    window.alert(s);
}

© 1997 by Microsoft Corporation. All rights reserved.