VBScript » Objects » Drive

Version: 3.0

The Drive object provides access to the various properties of the local or remote disk drive.

Examples

Code:
<%
Set filesys = CreateObject("Scripting.FileSystemObject")
Set drv = filesys.GetDrive("c")
%>
Explanation:

This code uses the GetDrive method of the FileSystemObject object to get the Drive object for drive "c".

Properties

AvailableSpace

Syntax: object.AvailableSpace

Returns the amount of space available on the specified local or remote disk space.

DriveLetter

Syntax: object.DriveLetter

Returns the dirve letter of the specified local or remote disk drive. Read only.

DriveType

Syntax: object.DriveType

Returns an integer indicating the type of the drive.

FileSystem

Syntax: object.FileSystem

This property returns the file system type that is in use on the specified drive.

FreeSpace

Syntax: object.FreeSpace

Returns the amount of free space available to a user on the specified local or remote drive.

IsReady

Syntax: object.IsReady

This property is a Boolean whose value is True if the specified drive is available for use and False otherwise.

Path

Syntax: object.Path

Returns the path for a specified file, folder or drive.

RootFolder

Syntax: object.RootFolder

Returns a Folder object that represents the root folder of the specified drive.

SerialNumber

Syntax: object.SerialNumber

Returns the decimal serial number for the specified drive. This number can be used to uniquely identify a disk volume.

ShareName

Syntax: object.ShareName

Returns the network name in Universal Naming Convention (UNC) for the remote disk drive. Used only when working with a remote drive (DriveType property is 3).

TotalSize

Syntax: object.TotalSize

Returns the total space, in bytes, of the specified drive.

VolumeName

Syntax: object.VolumeName

Sets or returns the volume name of the specified drive.

Events

Initialize

See Also: