Last month, I walked you through the features of the FileSystemObject objectthe root object of the File System Object (FSO) modelto help you understand the FSO hierarchy and the role of each available object. This month, I examine in detail the methods and properties of the Drive object.
The Drive Object's Methods and Properties
The Drive object provides information about drives connected to a system. Although the Drive object might seem simple, the Drive object has a lot to offer. As Table 1 shows, you can use the Drive object's properties to return such information as a drive's type of file system, free space, and volume name. However, the Drive object doesn't return information about a drive's content. To retrieve information about the files and folders on a drive, you must use the Folder object, which I'll cover next month.
To work with any of the Drive object's properties, you need to reference the Drive object through the FSO root object. You must use the CreateObject function to instantiate (i.e., create an instance of) the FileSystemObject object and assign that instance to a variable. You can then reference the Drive object with the FileSystemObject object's GetDrive method or Drives property. . . .