Open In App

ASP AvailableSpace Property

The ASP AvailableSpace Property is used for returning the amount of available space left on a drive. It returns the value in bytes.

Syntax:



DriveObject.AvailableSpace

Example: The below code illustrates the ASP Drive.AvailableSpace Property. 




<%
Dim fs,dr
Set fs=Server.CreateObject("Scripting.FileSystemObject")
 
'Getting the drive to be checked
Set dr=fs.GetDrive("d:")
 
Response.Write("The drive: " & dr)
 
'Getting the available space of the drive
Response.Write(" has available space: " & dr.AvailableSpace)
 
set dr=nothing
set fs=nothing
%>

Output:



The drive: D: has available space: 992345694
Article Tags :