ASP Drive



The Drive object is used to return information about a local disk drive or a network shared drive.


tryitimg.gif

Try it - Example

Get the total capacity of the specified drive
This example demonstrates how to use the TotalSize property to get the total capacity of the specified drive.

Get the available space of the specified drive
This example demonstrates how to first create a FileSystemObject object, and then use the AvailableSpace property to obtain the available space of the specified drive.

Get the remaining space capacity of the specified drive
This example demonstrates how to use the FreeSpace space attribute to obtain the remaining space of the specified drive.

<a target="_blank" href="../try/showasp--filename-demo_driveletter.html" "="">Get the drive letter of the specified drive
This example demonstrates how Use the DriveLetter property to get the drive letter of the specified drive

Get the drive type of the specified drive
This example demonstrates how to use the DriveType property to get the drive type of the specified drive.

Get the drive type of the specified drive. File system information
This example demonstrates how to use FileSystem to obtain the file system information of the specified drive.

Is the drive ready?
This example demonstrates how to use the IsReady property to check whether the specified drive is ready. Ready.

Get the path of the specified drive
This example demonstrates how to use the Path property to obtain the path of the specified drive.

This example demonstrates how to obtain the root folder of the specified drive. Use the RootFolder property to obtain the root folder of the specified drive.


Get the serial number of the specified drive.

This example demonstrates how to use the Serialnumber property to obtain the serial number of the specified drive.


Drive object

The Drive object is used to return information about a local disk drive or a network shared drive. The Drive object can return information about the drive's file system type, remaining capacity, serial number, volume label name, etc.

Note:

You cannot return information about the drive contents through the Drive object. To achieve this, use the Folder object. To manipulate the related properties of the Drive object, you You need to create an instance of the Drive object through the FileSystemObject object. First, create a FileSystemObject object, and then instantiate the Drive object through the GetDrive method of the FileSystemObject object or the Drives property. The properties of the Drive object are described as follows:

Properties

PropertiesDescription
AvailableSpaceReturn to the user in The amount of free space on the specified drive or network share.
DriveLetter Returns the uppercase letter identifying a local drive or network shared drive.
DriveTypeReturns the type of the specified drive.
FileSystemReturns the file system used by the specified drive.
FreeSpaceReturns the remaining space capacity on the specified drive or network shared drive to the user.
IsReadyReturns true if the specified drive is ready. Otherwise return false.
Path Returns an uppercase letter followed by a colon to indicate the pathname of the specified drive.
RootFolderReturns a folder object that represents the root folder of the specified drive.
SerialNumberReturns the serial number of the specified drive.
ShareNameReturns the network share name of the specified drive.
TotalSizeReturns the total capacity of the specified drive or network share drive.
VolumeNameSet or return the volume label name of the specified drive.