DriveInfo

Description: Returns information about a disk drive.
Returns: Pointer  (see comments)
Usage: Script Only.
Function Groups: Software and Hardware
Related to: Dir | FileFind
Format: DriveInfo(Attributes, Option)
Parameters:  
Attributes   
Required. 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   
Required. 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 VTScada Redirect statement).

This function returns 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 following table.

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.