Compress Files Action
<AMCOMPRESS TYPE="options" SOURCE="text" COMPRESSION="options" PATHINFO="options" EXCLUDE="text" OVERWRITE="yes/no" ISNEWER="yes/no" ISNEWERTHAN="datetime" ISOLDERTHAN="datetime" ARCHIVETURNOFF="yes/no" PASSWORD="text" DOSFORMAT="yes/no" ATTRFILTER="text">
Compresses files into the file specified. To specify more than one file to compress use wildcards ( e.g. * or ? ). To specify multiple files or wildcard masks, separate them with a vertical bar. Example: c:\*.txt|c:\*.bak
Usually used to compress files before backing up or in preparation for transfer over the Internet via email or FTP.
Specifies the file(s) to compress. 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 copy all files matching a certain mask. Multiple file and/or file masks may be specified by separating the entries with the | symbol.
Specifies the destination folder and filename for the file(s) being compressed. This should be a fully qualified path with a filename. Folders that do not exist will be automatically created at runtime.
Specifies the type of compression that should be used for the file(s) being compressed. AutoMate supports the following compression types:
Specifies the level of compression that should be used for the file(s) being compressed. The more compression that is used the slower the process. "none" is the fastest option.
The available options are:
Max: The highest level of compression, resulting in the smallest files but slower operation.
Normal: Standard compression algorithm used, offers a good balance of speed and file size.
Fast: Faster operation, less compression and slightly larger target file.
Superfast: Even faster operation, even less compression and larger target file.
No Compression: Fastest, no compression applied whatsoever. Useful for combining files into a package quickly when size is not a concern.
When set to YES, specifies that, if present, subfolders should be searched for files matching the mask specified in the Files to compress parameter.
Valid only if the Include subfolder parameter is set to YES. When set to YES, specifies how path information should be stored in the compressed file that is created. If the Include subfolders parameter is set to NO this parameter is ignored.
The available options are:
none: folder information is not preserved
relative: folder information relative to (beneath) the current folder is stored in the compressed file, folders above the current source directory will not be stored. For example If compressing c:\documents\folder\*.*, the path of \folder\ will be stored in the file.
absolute: Full folder information is stored in the compressed file, including folders above the current source folder. For example If compressing c:\documents\folder\*.*, the full path of \documents\folder\ will be stored in the file.
Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES, specifies that subfolders found in the source folder should be created in the destination folder even if they are empty (i.e. they do not contain any files).
When set to YES, specifies that, if matching file(s) already exist in the compressed file they should be overwritten.
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 compressed file will be overwritten.
When set to YES, specifies that the "archive" attribute of the source file(s) should be switched OFF. The Windows "archive" attribute is generally used to track whether a file has been backed-up, by turning the source file's archive attribute off - this indicates to many backup programs that the file has already been backed-up.
When set to YES, specifies that the filenames in the compressed file should be truncated to their 8.3 DOS style equivalents. Should only be enabled if the compressed file will be used on an older operating system that does not support long filenames.
If specified, causes the compressed file to be password protected - thus the user will be prompted for a password upon extraction.
Causes the action to not compress files matching the mask(s) specified. Filenames or wildcard (i.e. * or ?) masks may be used, multiple entries may be specified by separating them with the | symbol (e.g. *.txt|*.bak)
Causes the action to only compress files 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).
Causes the action to only compress files 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 parameter).
This group of settings causes the action to filter which files are compressed based on the attribute settings of the source file(s). In visual mode, a group of controls are provided to assist in the selection of this parameter.
In markup mode, build a single text item must be specified that contains the attributes of the files you wish to compress.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
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
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMCOMPRESS SOURCE="c:\sourcefolder\*.*" FILE="c:\targetfolder\targetfilename.zip" COMPRESSION="fast" PATHINFO="none" EXCLUDE="*.txt" OVERWRITE="YES" ISNEWER="YES" ISNEWERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%" ISOLDERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%" ARCHIVETURNOFF="YES" PASSWORD="test" DOSFORMAT="YES" ATTRFILTER="+a">