Description: This function returns information about a disk drive.
Returns: Pointer (see comments)
Usage: Script
Format: DriveInfo(Attributes, Option)
Parameters:
Attributes
{ numeric } { required } { no default
}
Any numeric
expression which gives the attributes to match for each drive. Drives that don't
match these attributes won't be listed. The Attributes parameter is constructed by adding
together the numbers from the table below:
|
Attribute |
Bit No. |
Drive Type |
|
1 |
0 |
Removable drive (floppy disk) |
|
2 |
1 |
Fixed drive (hard disk) |
|
4 |
2 |
Remote drive (network disk) |
|
8 |
3 |
CD-ROM drive |
Option { numeric } { required } { no
default }
Any numeric
expression giving the type of text information to generate. All information is
placed in a single text string (which will be stored in an element of the array
that is created). The information is written from left to right, with lowest
option numbers first.
|
Option |
Bit No. |
Information Type |
|
1 |
0 |
Drive type |
|
2 |
1 |
Drive letter and colon (e.g. C:) |
|
4 |
2 |
Volume name |
|
8 |
3 |
Total volume space (in bytes) |
|
16 |
4 |
Volume space available (in bytes) for consumption |
Comments: This function will only return information on network drives that have been assigned drive letters (i.e. those having been used in a Windows™ command prompt "net use" statement or VTS Redirect statement).
This function returns a pointer to an array of text values (one element per drive). Each text value contains the information specified by Option for each drive that matches Attributes. The size information is expressed as a text string of a decimal number of the requested value concatenated with the other information. The drive type is returned as a number, as shown in the table below.
|
Value |
Drive Type |
|
0 |
Removable drive (floppy disk) |
|
1 |
Fixed drive (hard disk) |
|
2 |
Remote drive (network disk) |
|
3 |
CD-ROM drive |
Example:
If ! Valid(drives);
[
drives = DriveInfo(6 { All hard and network disks },
3 { Drive type and letter });
]
Table(drives[0] { Start at beginning of array },
ArraySize(drives, 0){ Number of elements in array },
10, 10, 0, 10 { First line point, vertical list },
4, 0, 100 { Text values; min/max chars },
15, 0, 0 { White on black background },
0, 0 { Standard height, no rotation });
This would list the drive types and letters, both fixed and remote, available on the system in table form in the upper left hand portion of the screen.
See Also: