Returns a DriveInfo object for the specified drive.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\).
drive is Nothing or an empty string.
The path exceeds the system-defined maximum length.
The user lacks necessary permissions to view the path
The DriveInfo class models a drive and provides methods and properties to query for drive information. Use DriveInfo to determine what drives are available, and what type of drives they are. You can also query the property to determine the capacity and available free space on the drive.
The following table lists examples of tasks involving the My.Computer.FileSystem.GetDriveInfo method.
Determine a drive's volume label
Determine a drive's type
Determine a drive's total space
Determine a drive's physical free space
Determine a drive's root folder
This example obtains a DriveInfo object for the C drive and uses it to display information about the drive.
For information on the different drive types, see DriveType.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.