Decompress Files

Declaration

<AMDECOMPRESS ARCHIVEFILE="text" DESTINATION="text" TYPE="zip" OVERWRITE="Yes/No" PASSWORD="text" EXCLUDE="text" />

See Also

Description

Decompresses one or more compressed files into the destination folder specified. Wildcards (i.e. * or ?) may be used to decompress files matching a certain mask.

Practical Usage

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

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Archive File(s)

Text

Yes

(Empty)

a)FILE="c:\source\zipfile.zip"
b)FILE="c:\sourcefolder\*.zip"

Specifies 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 (i.e. * or ?) may be used to specify all files matching a certain mask.

Extract to Folder

Text

Yes

(Empty)

DESTINATION="c:\destination\"

Specifies the destination folder for the file(s) being decompressed. This should be a fully qualified path. Folders that do not exist will be automatically created at runtime.

Compression Type

Text Options

Yes

Zip

TYPE="zip"

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

  • 7Zip

Options Properties

Property

Type

Required

Default

Markup

Description

Restore Folder Structure

Yes/No

No

Yes

CREATEFOLDERS="no"

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. This parameter is set to YES by default.

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.

Use this password if needed

Text

No

(Empty)

PASSWORD="mypassword"

If specified, uses the password entered to decompress a password protected file.

Exclude Mask

Text

No

(Empty)

EXCLUDE="*.txt"

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

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane 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" />

 

↑ Top of Page