Process archive files automatically

Unzip files Action is a constituent part of Automation Workshop, a business process automation (BPA) software for Windows. With the Unzip files Action you can automatically extract files and folders from archives without user presence. Zip uncompression process or unzipping can be started manually by user, or automatically, on schedule or some event in the system.

For example, file unzipping can start automatically when a new zip file is detected in specified folder by File / Folder Watcher, the file monitoring Trigger, or upon user login, during Windows startup or on simple or advanced schedule. Also, the Unzip files Action can be a part of the Task that contains multiple Actions, and thus extract compressed files from archive after another Action has finished its operations. This way, the automatic file unzipping can start after an archive file has been copied to specified folder, or when a third-party application has completed, or after any other Automation Workshop Action.

The automatic Unzip files Action features the following uncompression options:

  • Support of the most recent zip file specification version.
  • Uncompression of Tar, Tar.gz, Tar.bz2, gzip and bzip2 files is also supported.
  • Decryption of archives encrypted with Advanced Encryption Standard AES-256 and AES-128 keys.
  • Support of legacy PKZIP passwords.
  • Full Unicode support for compressed file, folder and archive names.
  • Recursively unzip all archive contents preserving the folder structure.

Provided the automatic character of the Unzip files Action application, it features some specific options that you would not find in most unzip programs that are operated by direct user interaction:

  • Automatic archive file specification by using dynamic Variable Wizard values.
  • Destination folder setting can contain flexible context-dependent references.
  • File mask support when specifying files and folders to uncompress.
  • Automatic uncompression error handling, error reporting and error logging.

The goal of automatic zip file uncompression tutorial. This tutorial will lead you through the creation of automation Task that will convert password unprotected tar.gz file to encrypted zip archive with removing *.tmp (temporary files) that might have accidentally gotten into the original archive.

Let us assume the following parameters for this sample Task:

  • The File / Folder Watcher Trigger monitors the C:\Tar\ folder for new tar.gz archives.
  • When a tar.gz archive arrives to C:\Tar\ folder, the Trigger automatically launches the Task.
  • The Task automatically runs the Unzip files Action.
  • The Unzip files Action queries the File / Folder Watcher Trigger for the name of detected archive.
  • The Unzip files Action extracts all files from the detected archive to the C:\Uncompressed\ folder.
  • The Task runs the Zip files Action that compresses the contents of C:\Uncompressed\ folder into a file (named after the original tar.gz archive) and put that file in the C:\Zip\ folder.
  • The Delete file Action automatically deletes all the content of C:\Uncompressed\ for the next Task execution.

This tutorial on how to convert tar.gz to zip files (by uncompressing tar.gz and compressing zip archives) consists of the following user steps:

  1. Creating a Task that includes File / Folder Watcher, Unzip files Action, and Zip files Action.
  2. Adding the File / Folder Watcher for monitoring the C:\Tar\ folder.
  3. Adding the Unzip files Action for automatic tar.gz decompression into the C:\Uncompressed\ folder.
  4. Adding the Zip files Action for automatic zip file compression to the C:\Zip\ folder.
  5. Adding the Delete files Action to delete the contents of the C:\Uncompressed\ folder.
  6. Disable simultaneous Task execution to avoid mixing files from various tar archives.

Creating a Task. Let us begin with creating a new automated Task, a primary unit of Automation Workshop. Open Automation Workshop Manager - the main interface of the business process automation application. Irrelevantly whether you choose the New Task option from File menu, click Ctrl+N, or right-mouse click in the Task pane, it will open the Task Wizard in the Welcome tab.

Task Wizard welcome properties

Adding the File / Folder Watcher Trigger for monitoring the folder. Once in the Welcome tab of Task Wizard, you can get acquainted with some basic concepts and click Next to go to the Triggers tab. Click the Add button and choose File / Folder Watcher from the list of available Triggers.

Add Trigger - File / Folder Watcher

Once in File / Folder Watcher Trigger, let's setup monitoring of C:\Tar\ folder for Tar.gz files. First, specify the Folder to watch, namely, the C:\Tar\ folder.

File / folder watcher - Watch: C:\Tar

Second, let us specify that the File / Folder Watcher Trigger monitors only for Tar.gz files. Specify the Include mask in the Filter tab to watch for *.Tar.gz (all Tar.gz files). Click OK and notice that the File / Folder Watcher file monitor has been added to the Triggers tab. Click Next to proceed to the Actions tab.

Adding the Unzip files Action for automatic tar.gz decompression. Once in the Actions tab, let us start to add the Actions. Choose the Unzip Files from the Compression category in the list of available Actions.

Add Action - Compression - Unzip files

First, let us specify which file to automatically decompress. Click on the Variable Wizard button next to Archive file parameter. In Variable Wizard choose File / Folder Watcher in the Trigger category.

Variable Wizard - File / folder watcher - Preset: Full path and filename

This effectively creates a link between File / Folder Watcher and Unzip Files. When a new Tar.gz file will arrive to the C:\Tar\ folder, the File / Folder Watcher Trigger will detect it and store its name in a dynamic variable. The stored dynamic variable will subsequently be retrieved by Unzip files Action and automatically used to specify which file exactly to uncompress.

Now let us specify the destination folder to which the archive will be uncompressed. Browse to the C:\Uncompressed\ folder (create if necessary).

Unzip Files - [Filename] to C:\Uncompressed

Note that Filename is a dynamic variable that depends on the file that is detected by file monitor File / Folder Watcher, not a fixed value which refers to a file with constant name. Click OK to return to the Actions tab of Task Wizard.

Adding the Zip files Action for automatic zip file compression. Now, let us add the Zip files Action. Specify files to compress parameter by entering C:\Uncompressed\*.* (all files in the C:\Uncompressed\ folder).

Zip Files - Files to compress: C:\Uncompressed\*.*

As a second step, we need to specify into which archive the contents of the original Tar.gz file (that are currently located in the C:\Uncompressed\ folder). Enter C:\Zip\ into the destination archive field and click the Variable Wizard. Since we wanted the zip file to have the same name as tar.gz archive, choose the Filename preset of File / Folder Watcher in Triggers category. Disable the extension since it will be replaced by .zip in the new archive.

Variable Wizard - Triggers - File / folder watcher - Preset: Filename

Return to the configuration of Zip files Action. Notice the dynamic Filename variable in the destination archive parameter that will assign the newly created zip file the name of original tar.gz archive.

Zip Files - C:\Uncompressed\*.* to C:\Zip\[Filename]

Let us configure the file encryption in the Options tab. Choose the ultra-secure AES-256 encryption key and write a strong password (preferably consisting of many alphanumerical characters along with special symbols).

Zip Files options - Maximum compression - AES-256 encryption

Go to the Filter tab to configure the exclude mask for automatic exclusion of *.tmp (temp files) from being added to the zip archive.

Zip Files filter - Exclude mask: *.tmp

Finish the configuration of the Zip files Action.

Adding the Delete files Action to delete the contents of the folder. Let us add the Delete files Action that will automatically delete all files in the C:\Uncompressed\ folder to clear it for the next tar.gz archive conversion to zip archive. Choose the Delete file Action from the File / Folder category. Provide C:\Uncompressed\*.* as the File parameter.

Delete files - File: C:\Uncompressed\*.*

Go to the Options tab of Delete file Action and enable the Include subfolders option to automatically delete subfolders and files within them. Click OK to save the settings and return to Task Wizard.

Actions - Unzip files; Zip files; Delete file

The structure of the Task is now in place. However now we should configure the Task to avoid multiple simultaneous executions which could lead to accidental mixing of files from multiple archives.

How to disable simultaneous Task execution to avoid mixing files from various tar archives? Click Next to go to Task's Run As settings, then to the Reports tab, to the Task tab where we can give Task a name, e.g. Convert tar.gz to zip automatically, and write an optional description.

Task Wizard - Convert tar.gz to zip automatically

Click Next to go to the Finish tab and click on Advanced options.

Task Wizard finish properties

Once in the Advanced options of the Task, go to the Settings tab and change the multiple instances execution setting If an instance of already running (or queued) task is being executed from the default Run task in parallel to Queue a new task instance until existing task finishes setting which allows only one instance of the Task running at a time.

Task settings - Queue a new task instance until existing task finishes

Note that the same Task properties as currently opened are accessible any time after saving the Task. Click OK to save and activate the Task.

Conclusion. We have created a Task to automatically convert tar.gz files to zip files (with removing temp files during the process). During the process we have added a File / Folder Watcher Trigger that automatically monitors the C:\Tar\ folder for new tar.gz files (*.tar.gz file mask). When a file arrives, the Trigger launches the Task which, in turn, sequentially performs the following Actions:

  • Unzip files Action automatically uncompresses the contents of monitored tar.gz file into C:\Uncompressed folder.
  • Zip files Action compresses the contents of C:\Uncompressed\ folder to zip file in C:\Zip folder.
  • Delete file Action clears C:\Uncompressed\ folder from all its contents.

Note that likewise it is possible to extend the Task in numerous ways by adding more sequential Actions. For instance, the created zip archive can be automatically moved to another folder, sent by email, reported by email, passed to external application, etc.

The File / Folder Watcher file monitoring Trigger is connected with Unzip files Action so that the latter receives the tar.gz archive name and path from the former. Also, the Zip files Action retrieves the original tar.gz archive file name from File / Folder Watcher to use it as a name for newly created zip file. Only the Delete file Action unconditionally deletes contents of the C:\Uncompressed\ folder without relying on some preceding Trigger or Action.

Also, we have seen how to choose between multiple Task instances running in parallel and queuing them one after another for sequential execution which plays a key role in this Task to prevent it from unwanted mixing of files from various archives.

Free trial 15 day trial · Details…
Buy now 30 day MBG · Details…

If you have any questions, please do not hesitate to contact our support team.

© 2001–2019 Febooti Ltd.