Many, if not all, new PCs have Recovery Partitions that are the second partition of a hard drive. Most vendors would advise that it is not in your best interest to alter data in the Recover Partition.
You can use
System.Io.DriveType
enumeration to differentiate drive type.
The example below selects the optical drive (CD or DVD).
string[] Drives = System.IO.Directory.GetLogicalDrives();
foreach (string strDrive in Drives) {
System.IO.DriveInfo di = new System.IO.DriveInfo(strDrive.Substring(0, 1).ToUpper());
if (di.DriveType == System.IO.DriveType.CDRom) {
strDVD = strDrive.Substring(0, 2);
}
}
A hard disk would be found using:
if (di.DriveType == System.IO.DriveType.Fixed) {
System.IO.DriveType Enumeration
Quote:
Unknown The type of drive is unknown.
NoRootDirectory The drive does not have a root directory.
Removable The drive is a removable storage device, such as a floppy disk drive or a USB flash drive.
Fixed The drive is a fixed disk.
Network The drive is a network drive.
CDRom The drive is an optical disc device, such as a CD or DVD-ROM.
Ram The drive is a RAM disk.