Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Determining Drive Type


How can my application tell if a given drive is a CD, Network, Ramdisk, or Removable drive?   

    Use the Windows API function GetDriveType().

    Example:
    procedure TForm .Button Click(Sender: TObject);
    begin
      case GetDriveType('C:\') of
        0              : ShowMessage('The drive type cannot be determined');
                       : ShowMessage('The root directory does not exist');
        DRIVE_REMOVABLE:ShowMessage('The disk can be removed');
        DRIVE_FIXED    : ShowMessage('The disk cannot be removed');
        DRIVE_REMOTE   : ShowMessage('The drive is remote (network) drive');
        DRIVE_CDROM    : ShowMessage('The drive is a CD-ROM drive');
        DRIVE_RAMDISK  : ShowMessage('The drive is a RAM disk');
      end;
    end;
    

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use