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

ID: Q176804


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0


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. Click the file names below to download the files:

Getdrive.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.


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: API drives

Keywords : kbcode kbfile kbsample kbnokeyword kbVFp300 kbVFp500 kbVFp600 kbDSupport
Version : WINDOWS:3.0,3.0b,5.0,5.0a,6.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: November 30, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.