Help detecting drive types. 
Author Message
 Help detecting drive types.

Hi, I'm writing an app, that scans users hard disks on our network to look
for copies of  a perticular program. Most of the users have at least a C:
hard disk, mut many of them also have D: and above.
What I need to do is to be able to detect if drives D: and above are hard
disks or CD/Network /LS120/Zip drives, so that these types are not scanned.
I have tried using the IOCTL functions (int 21h, fn 44) for determining if a
drives is networked or removable, But this seems not to be able to identify
the drives correctly (it says that a cd drive is local, which is correct,
but nonremovable, which is not !). The code needs to work under Dos, Win9x
and WinNT (if possible),
does anyone have any pointers or sugestions as to what might be worth
trying.....

Thanks for any help.

Can you CC: replies by mail.

Phill.



Wed, 18 Jun 1902 08:00:00 GMT  
 Help detecting drive types.

Quote:

>Hi, I'm writing an app, that scans users hard disks on our network to look
>for copies of  a perticular program. Most of the users have at least a C:
>hard disk, mut many of them also have D: and above.
>What I need to do is to be able to detect if drives D: and above are hard
>disks or CD/Network /LS120/Zip drives, so that these types are not scanned.
>I have tried using the IOCTL functions (int 21h, fn 44) for determining if a
>drives is networked or removable, But this seems not to be able to identify
>the drives correctly (it says that a cd drive is local, which is correct,
>but nonremovable, which is not !). The code needs to work under Dos, Win9x
>and WinNT (if possible),
>does anyone have any pointers or sugestions as to what might be worth
>trying.....

The following function returns the CDRom drives (in real mode)

Function CDRoms:String;
var rg:registers;
    cdr:string[26];
    count,i:word;
begin
  CdRoms:='';
  {$ifdef msdos}
  if swap(dosversion)<5 then exit;
  rg.ax:=$1500;
  rg.bx:=0;
  intr($2f,rg);
  if rg.bx=0 then exit;
  cdr:='';
  for i:=1 to rg.bx do cdr:=cdr+chr(rg.cx+i+64);
  CDRoms:=cdr;
  {$endif}
End;

Check my message under subject "Re: function to verify if a drive exists"
also.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detect a network drive

2. Detecting Drives > 2Gb in BP7

3. Detecting Local Drives

4. Displaying PCX or BMP @ 640x480x256 + detecting disk drives?

5. Detecting drive ready in TPW 1.5

6. How Do I Detect a Drive Serial Number?

7. Drive type under OS2 (Virtual pascal or C'T patch)

8. Detecting Types in Pascal?

9. Detecting the Sound Blaster type

10. Detecting Sound Blaster type

11. Detecting Cyrix Chip revision, stepping, and type

12. Detecting file type

 

 
Powered by phpBB® Forum Software