• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Disk Type?

How can I determine a Disk Type (floppy, CD, HD) etc.?

A function would be nice if someone would code it for me!  I'm offering lots of points so I can get this major project finished.
0
MoonCalf
Asked:
MoonCalf
1 Solution
 
JaymolCommented:
MoonCalf,

Try this function that I use...

////////////////////////////////////////

function DriveType(Drv: String): String;
var
  DType      :      Integer;
begin
  If Pos(':\', Drv)=0 then
        Drv:=Drv+':\';
  DType:=GetDriveType(PChar(Drv));
  Case DType of
    0,1                                          : Result:='unknown';
    DRIVE_REMOVABLE : Result:='Removable Drive';
    DRIVE_FIXED             : Result:='Hard Disk';
    DRIVE_REMOTE             : Result:='Remote Drive';
    DRIVE_CDROM             : Result:='CD-ROM';
    DRIVE_RAMDISK       : Result:='RAM-Disk';
  end;
end;

////////////////////////////////////////

Hope this helps...

John.
0
 
MoonCalfAuthor Commented:
Sooooo simple, when you know how!

Thanks a lot John.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now