August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.Drive
The Drive property returns the drive letter of the drive on which the specified file or folder resides.
Listing 9.56 shows how the Drive property is used to get the letter of the drive that contains the specified file.
<html> <BODY> <script language="JScript"> <!-- Hide // function gets the drive letter on which the file resides and // then informs the user of the drive. function get() { var myObject, f, d; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.GetFile("c:\\test.txt"); d = f.drive; alert("The drive that test.txt resides is: " + d); } //--> </script> Get ... |
Read now
Unlock full access