FileSystemObject.Drives
JScript3.0+Syntax
filesystemobject.Drives
Description
The Drives collection is a collection that holds all the Drive objects. It is used to get an object consisting of all the drives.
Example
Listing 9.78 shows how to check for drives.
Listing 9.78 Example of Drives
<html> <body> <script language="JScript"> <!-- Hide function getdrive() { var myObject, drive, e; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); drive = myObject.Drives; // Store drives in a enumerator e e = new Enumerator(drive); alert("The first drive is: " + e.item()); } // End Hide --> </script> <form name="myForm"> <input type="Button" value="Get Drive Name" onClick='getdrive()'> </form> ... |
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.