General discussion

Locked

Hard Drives and Partitions Using VB

By JCBR ·
Using Visual Basic, I want to be able to identify:
1. Each physical hard drive,
2. Each logical drive letter on each physical hard drive, and
3. The cluster (allocation unit) size for each logical drive.

Windows 98's "System Properties > Device Manager > Settings" can find items 1 and 2. The command CHKDSK, within a DOS window, can find item 3.

I have tried various search keys on various web sites, searched the Windows API functions, without success. All I have found are examples for finding available space on hard drives, but nothing regarding physical drives and their partioned logical drives.

Any help that you can give me, pointing to suitable API's or elsewhere, will be greatly appreciated.

My interest is with VB6 and later, and Windows 98 and later.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Hard Drives and Partitions Using VB

by fromnaija In reply to Hard Drives and Partition ...

I can help with your questions 1 & 2 off the top of my head now. I may post an answer to question 3 some other time.

Using GetLogicalDriveStrings API, you can obtain a string containing the root drive paths for all current logical drives.

Youcan also use the GetDriveType API to determine the type of a disk drive. This will return the constant DRIVE_FIXED if a physical hard drive.

I hope this helps but you may get in touch if you need help with the API declaration.

Kind regards.

Collapse -

Hard Drives and Partitions Using VB

by JCBR In reply to Hard Drives and Partition ...

fromnaija:

Thanks for your suggestions. Unfortunately, these deal only with data on logical disk drives, not on the containing physical disk drives. I need to be able to relate each logical drive to the physical disk drive on which it resides.For example, logical drives C, E, F reside on physical drive 0, and logical drives D, G, H reside on physical drive 1.

Thanks again,

JCBR

Collapse -

Hard Drives and Partitions Using VB

by JCBR In reply to Hard Drives and Partition ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums