Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Drives

Posted on 2000-02-18
5
Medium Priority
?
209 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 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

782 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