FileSystemObject.DriveExists()
JScript3.0+Syntax
filesystemobject.DriveExists(letter)
Description
The DriveExists() method is used to determine whether a drive exists or not. This method takes letter as a parameter, which specifies a drive letter to look for.
Example
Listing 9.77 shows how to check for the existence of a D drive.
Listing 9.77 Example of DriveExists()
<html> <body> <script language="JScript"> <!-- Hide // function checks for the existance of drive D. function checkDrive() { var myObject; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); // Check for the existance of a D drive if(myObject.DriveExists("d")){ alert("Drive D exists"); } else { alert("Drive D doesn't exist"); ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.