Solved

Drives

Posted on 2000-02-18
5
205 Views
Last Modified: 2010-04-04
How can I get letters of all floppy, hard and network drives ???
0
Comment
Question by:zeko
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:edey
ID: 2535949
is this what you're looking for?

The GetLogicalDrives function returns a bitmask representing the currently available disk drives.

DWORD GetLogicalDrives(VOID)


Parameters

This function has no parameters.

Return Value

If the function succeeds, the return value is a bitmask representing the currently available disk drives. Bit position 0 (the least-significant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, and so on.
If the function fails, the return value is zero.


Gl
Mike
0
 

Author Comment

by:zeko
ID: 2536426
That's ok.
But how can I detminate which drive is
floppy or network drive, and which are
physical hard disk ?
0
 
LVL 6

Accepted Solution

by:
edey earned 20 total points
ID: 2536454
after getLogicalDrives you can call getDriveType:

The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.

UINT GetDriveType(

    LPCTSTR  lpRootPathName       // address of root path
   );      
Parameters

lpRootPathName

Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.

Return Value

The return value specifies the type of drive. It can be one of the following values:

Value      Meaning
0      The drive type cannot be determined.
1      The root directory does not exist.
DRIVE_REMOVABLE      The drive can be removed from the drive.
DRIVE_FIXED      The disk cannot be removed from the drive.
DRIVE_REMOTE      The drive is a remote (network) drive.
DRIVE_CDROM      The drive is a CD-ROM drive.
DRIVE_RAMDISK      The drive is a RAM disk.





GL
Mike
0
 

Author Comment

by:zeko
ID: 2536585
Thanks.
0
 
LVL 6

Expert Comment

by:edey
ID: 2536610
Glad to be of service :)


GL
Mike
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question