Microsoft KB Archive/176804

= Getdrive.exe: How To List the Drives on a Win32 System =

Article ID: 176804

Article Last Modified on 3/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q176804



SUMMARY
This code example uses Windows Application Programming Interface (API) functions to return information on the drives installed or mapped to the local computer. These drives include both CD-ROM devices and network hard drives.

The following files are available for download from the Microsoft Download Center:

Getdrive.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.



MORE INFORMATION
This code example provides information about the drives installed and mapped to a given computer, including CD-ROM drives. The following information about each individual drive appears within a window created by the MessageBox function:


 * Drive letter
 * Drive type
 * Volume name
 * Volume
 * Serial number
 * Maximum file name length
 * File system flags
 * File system name

The program also provides specific physical information about the drive, such as sectors/clusters, bytes/sector, free clusters, and total clusters.

To run the program, type the following command in the Visual FoxPro Command window: DO GetDrive.prg

Additional query words: Getdrive API drives

Keywords: kbinfo kbdownload kbfile kbsample kbcode KB176804

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.