Drive.AvaliableSpace

JScript3.0+Syntax

							driveobject.AvaliableSpace

Description

The AvaliableSpace property of the Drive object contains the amount of space available to the user on the specified drive or shared network.

Example

Listing 9.26 displays the available space on drive C.

Listing 9.26 Find Available Space on Drive C
 <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 the available space document.write("Available space for drive ",drivePath," is "); document.write(drive.AvailableSpace); ...

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.