August 1999
Intermediate to advanced
1488 pages
72h 53m
English
driveobject.DriveLetter
The DriveLetter property of the Drive object contains the drive letter of the local drive or a shared network.
Listing 9.27 retrieves the drive letter for the specified drive.
<script language="JScript">
<!-- Hide
//Create a string to hold the drive path
var drivePath = "C:";
//Create a file system object
var fileSysObj = new ActiveXObject("Scripting.FileSystemObject");
//Create a Drive object for drive C
var drive = fileSysObj.GetDrive(fileSysObj.GetDriveName(drivePath));
//Display the drive letter
document.write("The driver letter for ",drivePath," is ",drive.DriveLetter);
//Hide End -->
</script>
|
Read now
Unlock full access