ASP Drive
The Drive object is used to return information about a local disk drive or a network shared drive.
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.
Get the serial number of the specified drive.
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
Properties | Description |
---|---|
AvailableSpace | Return 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. |
DriveType | Returns the type of the specified drive. |
FileSystem | Returns the file system used by the specified drive. |
FreeSpace | Returns the remaining space capacity on the specified drive or network shared drive to the user. |
IsReady | Returns 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. |
RootFolder | Returns a folder object that represents the root folder of the specified drive. |
SerialNumber | Returns the serial number of the specified drive. |
ShareName | Returns the network share name of the specified drive. |
TotalSize | Returns the total capacity of the specified drive or network share drive. |
VolumeName | Set or return the volume label name of the specified drive. |