I am trying to write a little backup program for friends and family and want it to be as simple to use a possible. I don\'t want to have to ask the user where to backup thei
I found a great function in the Win32 API for testing the type of drive.
if( 2 == ::getDriveType( )){
// its removable
}
Return values of function:
DRIVE_UNKNOWN 0: The drive type cannot be determined.
DRIVE_NO_ROOT_DIR 1: The root path is invalid; for example, there is no volume mounted at the specified path.
DRIVE_REMOVABLE 2: The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.
DRIVE_FIXED 3: The drive has fixed media; for example, a hard disk drive or flash drive.
DRIVE_REMOTE 4: The drive is a remote (network) drive.
DRIVE_CDROM 5: The drive is a CD-ROM drive.
DRIVE_RAMDISK 6: The drive is a RAM disk.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364939(v=vs.85).aspx