To return information about a local
disk drive or a network share,the Drive object is used.To know about a drive's type of file system, free space,
serial number, volume name, and more, the Drive object is used.
Note: With the Drive
object, you cannot return information about a drive's content. The Folder object is used for this purpose .
You will have to create an instance of the Drive object through the
FileSystemObject object to work with the properties of the Drive object . First; create a FileSystemObject object
and then instantiate the Drive object using GetDrive
method or the Drives property of the FileSystemObject object.
To instantiate the Drive object and the
TotalSize property to return the total size in bytes of the
specified drive (D:),the following example uses the GetDrive method of the
FileSystemObject object :