Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130400001

AvailableSpace / FreeSpace / TotalSize, Drive Object, ASP Server Component

Drive Object

One key function of FileSystemObject Component is the manipulation of drives of the file system.

DriveObject.AvailableSpace

DriveObject.AvailableSpace property is a property to get and return the amount of space available to a user on the specified drive or network share of the specified Drive object instance.

Syntax:

DriveObjectName.AvailableSpace

 Or in VBScript. Imply

 driveavailspace =DriveObjectName.AvailableSpace

 Or in JScript. Imply

 driveavailspace =DriveObjectName.AvailableSpace

Parameters:

driveavailspace

The parameter "driveavailspace" is the name assigned to the value returned by the AvailableSpace property referred to the specified Drive object.

DriveObjectName

The parameter "DriveObjectName" is used to specify the name of the instance of the Drive Object related to.

Returns:

 value

The return value of the AvailableSpace property is the available space of the specified Drive to a user in byte.

Remarks:

DriveObjectName refers to a Drive Object.

The value returned by the AvailableSpace property is typically the same as that returned by the FreeSpace property unless computer systems that support user quotas.

Examples:

  • Example of using the AvailableSpace property to to get and return the amount of space available to a user on the specified drive.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, DriveObjectName, driveavailspace
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set DriveObjectName = fso.GetDrive("d")
    driveavailspace = DriveObjectName.AvailableSpace
    Response.Write driveavailspace & "<br />"
    </script>

    HTML web page ouput:

    415712030720

  • Example of using the AvailableSpace property to to get and return the amount of space available to a user on the specified drive.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, DriveObjectName, driveavailspace;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    DriveObjectName = fso.GetDrive("d")
    driveavailspace = DriveObjectName.AvailableSpace 
    Response.Write (driveavailspace+ "<br />");
    </script>

    HTML web page ouput:

    415712030720

DriveObject.FreeSpace

DriveObject.FreeSpace property is a read only property to get and return the amount of free space available to user on the specified drive or network share of the specified Drive object instance.

Syntax:

DriveObjectName.FreeSpace

 Or in VBScript. Imply

drivefreespace =DriveObjectName.FreeSpace

 Or in JScript. Imply

drivefreespace =DriveObjectName.FreeSpace

Parameters:

drivefreespace

The parameter "drivefreespace" is the name assigned to the value returned by the FreeSpace property referred to the specified Drive object.

DriveObjectName

The parameter "DriveObjectName" is used to specify the name of the instance of the Drive Object related to.

Returns:

 value

The return value of the FreeSpace property is the free space of the specified Drive available to a user in byte.

Remarks:

DriveObjectName refers to a Drive Object.

The value returned by the FreeSpace property is typically the same as that returned by the AvailableSpace property unless computer systems that support user quotas.

Examples:

  • Example of using the FreeSpace property to to get and return the amount of space available to a user on the specified drive.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, DriveObjectName, drivefreespace
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set DriveObjectName = fso.GetDrive("d")
    drivefreespace = DriveObjectName.FreeSpace
    Response.Write drivefreespace & "<br />"
    </script>

    HTML web page ouput:

    415712030720

  • Example of using the FreeSpace property to to get and return the amount of space available to a user on the specified drive.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, DriveObjectName, drivefreespace;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    DriveObjectName = fso.GetDrive("d")
    drivefreespace = DriveObjectName.FreeSpace 
    Response.Write (drivefreespace+ "<br />");
    </script>

    HTML web page ouput:

    415712030720

DriveObject.TotalSize

DriveObject.TotalSize property is a property to get and return the amount of total space on the specified drive or network share of the specified Drive object instance.

Syntax:

DriveObjectName.TotalSize

 Or in VBScript. Imply

drivetotalsize =DriveObjectName.TotalSize

 Or in JScript. Imply

drivetotalsize =DriveObjectName.TotalSize

Parameters:

drivetotalsize

The parameter "drivetotalsize" is the name assigned to the value returned by the TotalSize property referred to the specified Drive object.

DriveObjectName

The parameter "DriveObjectName" is used to specify the name of the instance of the Drive Object related to.

Returns:

 value

The return value of the TotalSize property is the total space of the specified Drive available in byte.

Remarks:

DriveObjectName refers to a Drive Object.

Examples:

  • Example of using the TotalSize property to to get and return the amount of total space available to a user on the specified drive.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, DriveObjectName, drivetotalsize
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set DriveObjectName = fso.GetDrive("d")
    drivetotalsize = DriveObjectName.TotalSize
    Response.Write drivetotalsize & "<br />"
    </script>

    HTML web page ouput:

    916312641536

  • Example of using the TotalSize property to get and return the amount of total space available to a user on the specified drive.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, DriveObjectName, drivetotalsize;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    DriveObjectName = fso.GetDrive("d")
    drivetotalsize = DriveObjectName.TotalSize 
    Response.Write (drivetotalsize+ "<br />");
    </script>

    HTML web page ouput:

    916312641536

Previous Month  APR  2013  Next Month
SMTWTFS
123456
78910111213
14151617181920
21222324252627
282930

Previous Month  JUN  2014  Next Month
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
2930

Sideway BICK Blog

04/04


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013