Calculate File Checksum Action

Declaration

<AMCALCHASH FILE="Text" HASHTYPE="Text" RESULTVARIABLE="Text" />

See Also

Calculate File Checksum Action-Setting Properties, Touch File Action

Description

Generates a hash (checksum) value for a file and places it into the specified AutoMate variable. While CRC is the default algorithm, the actions also supports MD5 and several SHA variants (in order from quickest but least accurate to slowest and most efficient).

Practical Usage

Used to validate the integrity of data by calculating a checksum using the selected algorithm. The result is placed in a variable, which can be stored for later validation of the file or compared with an earlier checksum to verify the file's integrity.

Parameters

General Tab

File

Text, Required
MARKUP: FILE="C:\FolderName\FileName.DOC

Specifies the path and file name for the file.  

Algorithm

Text, Optional - Default "CRC"
MARKUP: HASHTYPE="MD5"

Specifies the algorithm to use.

Options are:
 

Populate Variable With the Checksum

Text, Required
MARKUP: RESULTVARIABLE="VariableName"

Specifies the AutoMate variable to populate with the checksum result.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

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

Example

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

<AMCALCHASH FILE="C:\FolderName\FileName.DOC" HASHTYPE="MD5" RESULTVARIABLE="VariableName" />