Solved

Drives

Posted on 2000-02-18
5
207 Views
Last Modified: 2010-04-04
How can I get letters of all floppy, hard and network drives ???
0
Comment
Question by:zeko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

635 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