DriveStatus

首页  后退  前进

DriveStatus
down2

DriveStatus

返回驱动器的状态.

 

DriveStatus ( "path" )

参数

path

驱动器的路径.

返回值

返回值

描述

$DS_UNKNOWN ("UNKNOWN")

驱动器可能未格式化 (RAW).

$DS_READY@DOUBLE_WS ("READY")

硬盘驱动器与包含可移动介质的驱动器.

$DS_NOTREADY@DOUBLE_WS ("NOTREADY")

软盘与不包含介质的光盘驱动器.

$DS_INVALID ("INVALID")

驱动器不存在或映射的网络驱动器无法访问.

 

常量定义在 "AutoItConstants.au3".

备注

以上列出的返回值可能不完整.

即使给定路径是驱动器的完整工作目录路径(必须是确实存在的),

DriveStatus 也能正常工作. 但文件路径无效.

 

函数示例

#include <MsgBoxConstants.au3>
Local $sStatus = DriveStatus(@HomeDrive & "\") ; Find the status of the home drive, generally this is the C:\drive.
MsgBox($MB_SYSTEMMODAL, "", "Status: " & $sStatus)

----------------------------------------

 

该函数可以通过命令 exect 调用

参见:

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, CDTray, FileExists

例子
copy

exect=$var_sstatus=DriveStatus('C:\')||_ViewValues('$var_sstatus') ;; 获取c:\驱动器的状态作为一个字符串

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru