Programmer Guide/Command Reference/DRIVE: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==DRIVE==
Without an argument, the <code>DRIVE</code> command retrieves a list of available drive letters, separated by blanks:
var := DRIVE [ [[Programmer_Guide/Command_Reference_Options/Silent|/Silent]] ]


<code>var := DRIVE [ /S ]</code>
Supplied with a drive letter as its argument, the <code>DRIVE</code> command will return the disk label of the respective drive:
var := DRIVE <var>driveLetter</var> [ <var>sizeUnit</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Silent]] ]


-> var = '1stdriveletter 2nddriveletter ...'
If <var>sizeUnit</var> is specified, the size of the drive, the free space and the space available to the user are also returned in the format <code>drivelabel ; size freeall freeuser</code>
 
Get the letters (A, B, ....) of the available drives.
 
<code>var := DRIVE <var>driveLetter</var> [<var>sizeUnit</var>] [ /S ]</code>
 
Get the label string of the drive <var>driveLetter</var>.
 
-> var = 'drivelabel' or empty
 
If <var>sizeUnit</var> is specified, the size of the drive, the free space and the space available to the user are also returned.
 
-> var = 'drivelabel ; size freeall freeuser' or empty


;<var>driveLetter</var>
;<var>driveLetter</var>
 
: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.
:The drive letter to query (e.g. A) or the file path (e.g. c:\files\test.txt) where the first letter is used.


;<var>sizeUnit</var>
;<var>sizeUnit</var>
:The possible values are <code>B</code> (byte), <code>KB</code> (kilobyte), <code>MB</code> (megabyte), and <code>GB</code> (gigabyte).


:The possible values are:
;<var>/Silent</var>
<code>B</code> (byte)<code>
:If specified, errors will generate warning messages rather than error messages. See [[Programmer_Guide/Command_Reference_Options/Silent|The Silent Flag]] for details.
KB</code> (kilobyte)<code>
MB</code> (megabyte)<code>
GB</code> (gigabyte)
 
;<var>/S</var>
 
:If specified, errors will generate warning messages rather than error messages. See The Silent Flag for details.


See the script file <code>drive_example.sts</code> for a working example.
See the script file <code>drive_example.sts</code> for a working example.

Latest revision as of 18:16, 24 April 2014

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.

Navigation menu

Personal tools