Compression - Decompress

Declaration

<AMFILESYSTEM ACTIVITY="decompress" SUBFOLDERS="yes/no" 
OVERWRITE="yes/no" EXCLUDE="text" RE="yes/no" 
ARCHIVEFILE="text" DESTINATION="text" PASSWORD="text (encrypted)" />

Description: Decompresses one or more compressed files into the destination folder specified. Wildcard characters (e.g., * or ?) may be used to decompress multiple files matching a certain mask.

Practical Usage

Usually used to decompress files received from the Internet via Email, FTP, HTTP or other means. Can also be used to extract files when restoring from a backup.

General Parameters

Property

Type

Required

Default

Markup

Description

Archive file(s)

Text

Yes

(Empty)

  1. FILE="c:\source\file.zip"

  2. FILE="c:\source\*.zip"

The file(s) to decompress. This can 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 specify all files matching a certain mask.

Extract to folder

Text

Yes

(Empty)

DESTINATION="c:\myFolder\"

The destination folder in which compressed files should be extracted to. This should be a fully qualified path. Folders that do not exist will be created at runtime.

Compression type

Text Options

Yes

Zip

  1. TYPE="zip"

  2. TYPE="jar"

  3. TYPE="gzip"

  4. TYPE="lha"

Indicates the compression type of the file(s) to be decompressed. The available options are:

Zip (Default) | Cab | LHA | Jar | GZip | Tar | Ace | Arj | Arc | Tar+GZip | 7Zip

Use this password if needed

Text

No

(Empty)

PASSWORD'"encrypted"

The password (if required) to extract the file. This parameter is required only if a password was previously set in the properties of the Compress activity.

File Options Parameters

Property

Type

Required

Default

Markup

Description

Include subfolders

Yes/No

No

No

SUBFOLDERS="yes"

If set to YES, subfolders will be included in the extraction.

Preserve folder structure

Yes/No

No

No

CREATEFOLDERS="yes"

If set to YES, specifies that subfolders present in the archive file should be automatically created and files should be placed in their corresponding subfolders upon decompression. Set to NO by default. This parameter is active only if the Include subfolders parameter is set to YES.

Overwrite if exists

Yes/No

No

No

OVERWRITE="yes"

If set to YES, indicates that if matching file(s) already exist in the destination folder, they should be overwritten. This parameter is set to NO by default.

Exclude mask

Text

No

(Empty)

  1. EXCLUDE="*.txt"

  2. EXCLUDE="*.txt|*.bak

  3. EXCLUDE="c:\foldename"

Causes this activity to omit decompressing files from the archive matching the mask(s) specified. Wildcard masks (e.g., * or ?) may be used. Multiple entries may be specified by separating them with a pipe symbol (|). Example: *.txt|*.bak

Regular expression

Yes/No

No

No

RE="yes"

If set to YES, indicates that any value entered in the Exclude mask parameter will be interpreted as a regular expression. If set to NO (default) the value will be interpreted as normal readable text.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: This sample step decompresses file(s) located in compressed file "c:\temp\ArchiveFile.zip" to "c:\TargetFolder\". It is set to overwrite existing files and exclude the file mask(s) "*.jpg".

<AMDECOMPRESS ARCHIVEFILE="c:\temp\ArchiveFile.zip" DESTINATION="c:\TargetFolder\" 
TYPE="zip" OVERWRITE="YES" PASSWORD="AM1TLax4GRtZO1P9mYTOXoER2pY3uoOmE4TaME" 
EXCLUDE="*.jpg" />