Decompress Files Action

Declaration

<AMDECOMPRESS ZIPFILE="text" DEST="text" OVERWRITE="yes/no" ISNEWER="yes/no" PASSWORD="text" EXCLUDE="text" ISNEWERTHAN="datetime" ISOLDERTHAN="datetime">

See Also

Compress Files Action, Encrypt Action, Decrypt Action, Calculate File Checksum Action, Split File Action

Description

Decompresses files from the specified compressed file into the destination folder specified. To specify more than one file to decompress use wildcards ( e.g. * or ? )

Practical Usage

Usually used to decompress files received from the Internet via e-mail or FTP or when restoring from a backup.

Parameters

General Tab

Archive File

Text, Required
MARKUP:
a) FILE="c:\sourcefoldername\zipfilename.zip"
b) FILE="c:\sourcefoldername\*.zip"

Specifies the file(s) to decompress. This parameter should be a fully qualified path and filename (preferred) or a single file (requires use of the Change Folder action). Wildcards ( e.g. *.* or ? ) may be used to decompress all files matching a certain mask.

Extract to Folder

Text, Required
MARKUP:DESTINATION="c:\sourcefoldername\"
 

Specifies the destination folder for the file(s) being decompressed. This should be a fully qualified path.

Options Tab

Restore Folder Structure

Yes/No, Optional default - YES
MARKUP: CREATEFOLDERS="NO"

When set to YES, specifies that, if present in source compressed file, subfolders should be automatically created and files placed in their corresponding subfolders.

Overwrite if exist

Yes/No, Optional default - NO
MARKUP: OVERWRITE="YES"

When set to YES, specifies that, if matching file(s) already exist in the destination folder they should be overwritten.

Only if newer

Yes/No, Optional default - NO
MARKUP: ISNEWER="YES"

Valid only if the "Overwrite if exist" [OVERWRITE] parameter is YES. When set to YES, specifies that only matching files that are newer than those in the destination folder will be overwritten.

Password protect files

Text, Optional default - (none) no password
MARKUP: PASSWORD="mypassword"

If specified, uses this password to decompress a password protected file.

Exclude Mask

Text, Optional default - (blank)
MARKUP: EXCLUDE="*.txt"

Causes the action to not decompress files from the archive matching the mask(s) specified. Filenames or wildcard ( e.g. * or ? ) masks may be used, multiple entries may be specified by separating them with the | symbol (e.g. *.txt|*.bak)

Only if newer than

date, Optional default - (none)
MARKUP: ISNEWERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Causes the action to decompress files from the archive only if the source is newer than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding "Only if newer" [ISNEWER] parameter).

Only if older than

date, Optional default - (none)
MARKUP: ISOLDERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Causes the action to decompress files from the archive if the source is older than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding "Only if newer" [ISNEWER] parameter).

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.

<AMDECOMPRESS ARCHIVEFILE="c:\temp\" DESTINATION="c:\targetfolder\" TYPE="zip" OVERWRITE="YES" />