DRIVE

From STX Wiki
Jump to navigation Jump to search

Without an argument, the DRIVE command retrieves a list of available drive letters, separated by blanks:

var := DRIVE [ /Silent ]

Supplied with a drive letter as its argument, the DRIVE command will return the disk label of the respective drive:

var := DRIVE driveLetter [ sizeUnit ] [ /Silent ]

If sizeUnit is specified, the size of the drive, the free space and the space available to the user are also returned in the format drivelabel ; size freeall freeuser

driveLetter
The drive letter to query (e.g. A) or a file path (e.g. "c:\files\test.txt") whose first letter will be interpreted as a drive letter.
sizeUnit
The possible values are B (byte), KB (kilobyte), MB (megabyte), and GB (gigabyte).
/Silent
If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.

See the script file drive_example.sts for a working example.