Compare Files Action

Declaration

<AMCOMPAREFILES FILEA="Text" FILEB="Text" TYPE="Text" HASHTYPE="Text" />

See Also

Compare Files Action-Setting Properties

Description

Compares two files and fails the step if they do not match. Files can be compared based on size, hash values (CRC, MD5 and several SHA variants), creation date, modified date, accessed date, or attributes.

Practical Usage

Used to validate backed-up or copied files.

Parameters

General Tab

File A

Text, Required
MARKUP: FILEA="C:\Folder\FileName.txt"

Specifies the path and file name for the first file.  

File B

Text, Required
MARKUP: FILEB="D:\Folder\FileName.txt

Specifies the path and file name for the second file.

Compare Type

Text [Options], Optional - Default "Size"
MARKUP: TYPE="CREATIONDATE"

Specifies the type of comparison to be made.

Options are:
 

Algorithm

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

Specifies the algorithm to use. Valid only if CRC/Hash (CRC) is selected as the Compare type.

Options are:
 

Notes

Custom Description

This action includes the Description tab for entering a 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

<AMCOMPAREFILES FILEA="C:\FolderA\FileName.txt" FILEB="C:\FolderB\FileName.txt" TYPE="CRC" HASHTYPE="SHA1" />