GetDrives()

Summary

Returns a list of disk drives and their type.

Syntax

drives = GetDrives(string type)

Argument Contents
type The type of drive that should be listed: "Removable", "Fixed", "Remote", "CD-ROM", or "RAM-drive". The default is "All" to list all drives on the system

Returns

An array of drive descriptions. Each element is an array of two items:

Element Type Contents
1 String The drive name (e.g. C:\)
2 String The drive type ("Removable", "Fixed", "Remote", "CD-ROM", "RAM-drive" or "Unknown")

Notes

  • "CD-ROM" refers to CD-ROM drives; "Removable" refers to other drives where the media can be removed (such as diskette drives, Zip drives, and Jaz drives); "Fixed" refers to non-removable local drives (hard disks); "Remote" refers to network drives; "RAM-drive" is a drive defined in memory.

  • Any drive with a network connection is classified as "Remote," even if the drive itself is a CD-ROM or a diskette drive.

Example

drvs = GetDrives("Fixed") // drvs might be {{"C:\\", "Fixed"}, {{"D:\\", "Fixed"}}

Error Codes

Error Type Meaning
Error Invalid type specified

See Also

Function Summary
GetDirectoryInfo() Gets a listing of the contents of a directory