Name

AvailableSpace (Drive Object) — drvObj . AvailableSpace

Synopsis

The number of bytes of space left on the current drive. It is inaccurate for drives with over 2GB of available space. This is a read-only property.

Parameters

None

Example

<%
' Dimension local variables. 
Dim fsoObject       ' FileSystemObject
Dim drvObject       ' Drive Object
Dim lngAvailBytes   ' Number of bytes available

' Instantiate the FileSystemObject variable.
Set fsoObject = Server.CreateObject( _
                "Scripting.FileSystemObject")
' Using the GetDrive method of fsoObject, initialize a 
' Drive object.
Set drvObject = fsoObject.GetDrive("\\PublicDocs")
' Retrieve the amount of space (in bytes) available 
' on the drive.
lngAvailBytes = drvObject.AvailableSpace
. . . [additional code]

%>

Notes

The only time the value for the AvailableSpace property and the value for the FreeSpace property will be different is if the drive supports quotas. For all practical purposes, you can use these two properties interchangeably.

Get ASP in a Nutshell, 2nd Edition 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.