Data Type: FileSystemObject object
A FileSystemObject object.
Data Type: String
A drive name, share name, or network path.
A Drive object.
Obtains a reference to a Drive object for the specified drive.
drivespecifier is a local
drive or the letter of a mapped drive, it can consist of only
the drive letter (e.g., “C”), the drive letter with a colon
(“C:”), or the drive letter and path to the root directory
(e.g., “C:\”) without generating a runtime error.
drivespecifier is a share
name or network path, GetDrive ensures that it exists as part of
the process of creating the Drive object; if it doesn’t, the
method generates runtime error 76, “Path not found.”
If the specified drive isn’t connected or doesn’t exist, runtime error 67, “Device unavailable,” occurs.
Individual drive objects can be retrieved from the Drives collection by using the Drives property. This is most useful, though, if you want to enumerate the drives available on a system. In contrast, the GetDrive method provides direct access to a particular Drive object.
If you are deriving the
drivespecifier string from a path, you should first use GetAbsolutePathName to insure that a drive is present as part of the path. Then you should use FolderExists to verify that the path is valid before calling GetDriveName to extract the drive ...