如果指定的驱动器存在则返回 true ;如果不存在则返回 false 。
object.driveexists(drivespec)
参数
object
必选项。 应为 filesystemobject 的名称。
drivespec
必选项。 驱动器号或完整的路径说明。
说明
对于可移动媒体的驱动器, 即使没有媒体 driveexists 方法也返回 true 。 可以使用 drive 对象的 isready 属性来决定驱动器是否就绪。
下面的例子说明了 driveexists 方法的用法。
function reportdrivestatus(drv){var fso, s = "";fso = new activexobject("scripting.filesystemobject");if (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 对象
闽公网安备 35060202000074号