Scripting the File System, Part I: The Drive Object - Doc JavaScript
Scripting the File System, Part I
The Drive Object
Drives | Collection |
The drives
collection holds a read-only collection of all available drives in the system. It has two properties:
Property | Description |
Count | Returns the number of items in the collection |
Item | Sets or returns an item from the collection that matches a specified key |
DriveType | Returns the drive type |
GetDrive(letterDrive) | Object |
This method returns the drive
object of the given drive name. The following script should create a drive
object for f
:
<SCRIPT LANGUAGE="JavaScript">
<!--
var fso = new ActiveXObject("Scripting.FileSystemObject");
driveObj = fso.GetDrive("f");
-->
</SCRIPT>
The drive
object does not have any methods. Here are the drive
object's properties:
Property | Description |
AvailableSpace | Returns the number of free bytes on the given drive |
DriveLetter | Returns the drive letter of a physical local drive or a shared network |
DriveType | Returns the drive type |
FileSystem | Returns the file system type for the specified drive |
FreeSpace | Returns the number of free bytes on the given drive |
IsReady | Returns the status of the drive |
Path | Returns the path of the given drive |
RootFolder | Returns the folder object of the root folder |
SerialNumber | Returns the unique serial number of the volume |
ShareName | Returns the shared name of a network drive |
TotalSize | Returns the total number of bytes on a specified drive |
VolumeName | Sets or returns the volume name of the specified drive |
Next: How to write a browser-independent HTML file
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: November 20, 2000
Revised: November 20, 2000
URL: https://www.webreference.com/js/column71/10.html