Drive.FreeSpace
JScript3.0+Syntax
driveobject.FreeSpace
Description
The FreeSpace property of the Drive object contains the amount of free space available to the user on the specified drive or shared network.
Example
Listing 9.30 retrieves the free space associated with the specified drive.
Listing 9.30 Display the Free Space
<script language="JScript"> <!-- Hide //Create a string to hold the drive path var drivePath = "C:"; //Create a file system object var fileSysObj = new ActiveXObject("Scripting.FileSystemObject"); //Create a Drive object for drive C var drive = fileSysObj.GetDrive(fileSysObj.GetDriveName(drivePath)); //Display free space on the drive document.write("Drive ",drivePath," has ",drive.FreeSpace," free space."); //Hide ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.