Get Volume Information

Declaration

<AMGETDRIVEINFO VOLUME="SINGLE" DRIVENAME="text" DRIVEINFO="text (options)" RESULTVARIABLE="text (variable name)" />

See Also

Change Printer | Display | Empty Recycle Bin | End Process | Get Process Information | Get Volume Information | Log Event | Print | Registry

File System - Get Information

 

Declaration

<AMGETDRIVEINFO VOLUME="SINGLE" DRIVENAME="text" DRIVEINFO="text (options)" RESULTVARIABLE="text (variable name)" />

See Also

Change Printer | Display | Empty Recycle Bin | Log Event | Print | Registry

Description

Retrieves specific information about a drive (volume type, volume label, user quota, capacity, available space, used space) and populates variable with the result or creates and populates a dataset that contains all parameters about all drives on the system.

Practical Usage

Used to retrieve system drive data (see Description). Volume sizes are expressed in KB.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

One Volume

Text

No

Enabled

VOLUME="SINGLE"

If enabled, specifies that this action will get a single volume's specific information and populate a variable with the results.

Volume

Text

No

A:\

DRIVENAME="C:\"

The volume from which to get data. This parameter is valid only if One Volume parameter is enabled.

Information to retrieve

Text (options)

No

Volume Type

DRIVEINFO="VOLUMELABEL"

The type of information with which to populate the variable. This parameter is valid only if One Volume parameter is enabled. The available options are:

  • Volume type (default)

  • Volume label

  • File system

  • Current user's available space

  • Total available space

  • Total capacity

  • Used space

Populate Variable With Result

Text

No

(Empty)

RESULTVARIABLE="VarName"

The name of an already created variable to be populated with the specified drive data. This parameter is valid only if One Volume parameter is enabled.

All Volumes

Text

No

Disabled

VOLUME="ALL"

If enabled, specifies that this action will get information in regards to all available volumes and populate a dataset with the results.

Dataset to Populate

Text

No

(Empty)

RESULTDATASET="VolumeInfo"

The name of the dataset to be created and populated with all volume data. This parameter is valid only if All Volumes parameter is enabled. More details in regards to the dataset that this action creates and populates can be found below under Notes.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).

Name

Type

Return Value

theDataset.Drive

Text

Returns the drive from which corresponding data is retrieved.

theDataset.VolumeType

Text

Returns the volume type (i.e. Removable)

theDataset.VolumeLabel

Text

Returns the volume label.

theDataset.FileSystem

Text

Returns the file system (i.e. NTFS)

theDataset.AvailableSpaceforUser

Number

Returns the current user's available space.

theDataset.TotalAvailableSpace

Number

Returns the total available space.

theDataset.TotalSizeofDrive

Number

Returns the total size of the drive.

theDataset.UsedSpace

Number

Returns the used space.

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Examples

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample task retrieves the total available space left on the C:\ drive and displays the results in a message box.

 

<AMVARIABLE NAME="theVar"></AMVARIABLE>

<AMGETDRIVEINFO VOLUME="SINGLE" DRIVENAME="C:\" DRIVEINFO="TOTALAVAILABLESPACE" RESULTVARIABLE="theVar" />

<AMMESSAGEBOX>The total available space left on the C:\ drive is %theVar% KB.</AMMESSAGEBOX>

 

↑ Top of Page