Retrieves information about the file system and volume associated with the specified root directory.
#Include <WinAPIEx.au3>
_WinAPI_GetVolumeInformation ( [$sRoot] )
$sRoot | [可选参数] The root directory of the volume to be described. If this parameter is empty string, the root of the current directory is used. A trailing backslash is required. For example, you specify "\\MyServer\MyShare" as "\\MyServer\MyShare\", or the "C" drive as "C:\". |
Success | The array that contains the following information: |
[0] - The name of a volume. | |
[2] - The serial number of a volume. | |
[1] - The maximum length, in TCHARs, of a file name component that a file system supports. | |
[3] - The flags associated with the file system ($FILE_*). | |
[4] - The name of the file system, for example, "FAT", "NTFS", etc. | |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Data = _WinAPI_GetVolumeInformation()
ConsoleWrite('Volume name: ' & $Data[0] & @CR)
ConsoleWrite('File system: ' & $Data[4] & @CR)
ConsoleWrite('Serial number: ' & $Data[1] & @CR)
ConsoleWrite('File name length: ' & $Data[2] & @CR)
ConsoleWrite('Flags: 0x' & Hex($Data[3]) & @CR)