FileSystemObject.GetDrive()

JScript3.0+Syntax

							filesystemobject.GetDrive(drive)

Description

The GetDrive() method is used to determine the drive specified in the drive parameter. This method takes drive as its only parameter, which represents the letter of drive for which to get information.

Example

Listing 9.83 shows how the GetDrive() method is used.

Listing 9.83 Example of GetDrive()
 <html> <body> <script language="JScript"> <!-- Hide function getdrive() { var myObject, drive; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); drive = myObject.GetDrive("c:\\") alert("Drive Name of drive C is: " + drive.VolumeName); } // End Hide --> </script> Get the name for Drive C. <form name="myForm"> ...

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.