假如指定的驅動器存在則返回 True ;假如不存在則返回 False 。
object.DriveExists(drivespec)
object
必選項。 應為 FileSystemObject 的名稱。
drivespec
必選項。 驅動器號或完整的路徑說明。
對于可移動媒體的驅動器, 即使沒有媒體 DriveExists 方法也返回 true 。 可以使用 Drive 對象的 IsReady 屬性來決定驅動器是否就緒。
下面的例子說明了 DriveExists 方法的用法。
function ReportDriveStatus(drv){var fso, s = "";fso = new ActiveXObject("Scrif (fso.DriveExists(drv))s += "Drive " + drv + " exists.";elses += "Drive " + drv + " doesn't exist.";return(s);}
Drive Object Drives Collection FileExists 方法 FolderExists 方法 GetDrive 方法 GetDriveName 方法 IsReady 屬性應用于: FileSystemObject 對象
新聞熱點
疑難解答