Solved

Drives

Posted on 2000-02-18
5
201 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now