Drive.DriveType
JScript3.0+Syntax
driveobject.DriveType
Description
The DriveType property of the Drive object contains a numeric value indicating type of the specified drive. The values associated with the DriveType are listed in Table 9.5.
Value | Description |
---|---|
0 | Unknown |
1 | Removable |
2 | Fixed |
3 | Network |
4 | CD-ROM |
5 | RAM Disk |
Example
Listing 9.28 retrieves the drive type for the specified drive.
Listing 9.28 Display the Drive Type
<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 Drive.FreeSpace var drive = fileSysObj.GetDrive(fileSysObj.GetDriveName(drivePath)); ... |
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.