Prerequisite

Top  Previous  Next

 

The Prerequisite command allows you to specify that the script should be executed ONLY if a Validation Command executes successfully. This command is used to ensure that anything that is actively required to process the script is present to allow the script to be successfully processed.

 

For example, if the script is designed to process a text file and make modifications to it the script could not be processed if the file did not exist. Therefore it would make sense to use a Prerequisite to make sure that the file exists before attempts are made to process it.

 

Command Syntax

 

Prerequisite:[ValidationCommand]:[ValidationCommandParameters]

 

The colon after each command is compulsory. Any additional spaces or characters will cause an error to be thrown. The command itself is not case sensitive, but parameters may be depending on the operating system and locale.

 

Parameters:

 

ValidiationCommand: The validation command to evaluate to determine whether or not processing can continue

ValidationCommandParameters: The parameters required by the ValidationCommand. These must be specified in the syntax of the chosen command

 

All parameters are compulsory. If any parameter is missing or invalid an error will be thrown.

 

Example:

 

This simple example demonstrates a Prerequisite command which allows processing to continue ONLY if the FileExists validation command confirms that the specified file actually exists:

 

Prerequisite:FileExists:"c:\Test Text.txt"

 

See Also: Conditional Commands Validation Commands