Group: File Management - Library: kernel32
The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive
Displaying the drive type value
Retrieving list of available disk drives
Using the GetLogicalDriveStrings
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Mapping and disconnecting network drives
Disconnecting USB Mass Storage Device programmatically
Detecting changes in connections to removable drives (VFP9)
UINT GetDriveType(
LPCTSTR lpRootPathName // root directory
);
DECLARE INTEGER GetDriveType IN kernel32 STRING nDrive
lpRootPathName [in] Pointer to a null-terminated string that specifies the root directory of the disk to return information about. A trailing backslash is required. If lpRootPathName is NULL, the function uses the root of the current directory
The return value specifies the type of drive
#DEFINE DRIVE_UNKNOWN 0
#DEFINE DRIVE_NO_ROOT_DIR 1
#DEFINE DRIVE_REMOVABLE 2
#DEFINE DRIVE_FIXED 3
#DEFINE DRIVE_REMOTE 4
#DEFINE DRIVE_CDROM 5
#DEFINE DRIVE_RAMDISK 6
See also: RealDriveType.