大网数据广告活动
磁盘与文件系统

Enumerating Volumes

· 52CE 我爱测

To make a complete list of the volumes on a computer, or to manipulate each volume in turn, you can enumerate volumes.

To make a complete list of the volumes on a computer, or to manipulate each volume in turn, you can enumerate volumes. Within a volume, you can scan for mounted folders or other objects on the volume.

Three functions allow an application to enumerate volumes on a computer:

These three functions operate in a manner very similar to the FindFirstFile, FindNextFile, and FindClose functions.

Begin a search for volumes with FindFirstVolume. If the search is successful, process the results according to the design of your application. Then use FindNextVolume in a loop to locate and process each subsequent volume. When the supply of volumes is exhausted, close the search with FindVolumeClose.

You should not assume any correlation between the order of the volumes that are returned by these functions and the order of the volumes that are returned by other functions or tools. In particular, do not assume any correlation between volume order and drive letters as assigned by the BIOS (if any) or the Disk Administrator.

See Mounted Folder Examples for an example of how to enumerate the volumes on a computer.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。