🧡 Skip to main content🔍 Skip to search
Thomas UnderwoodBy Thomas Underwood 🕔 Updated on June 17, 2021 at 5:00 pm

Unzip Files Action is a constituent part of Automation Workshop, a IT process automation 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.

Get the Demo Task…

The goal

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 monitors the C:\Tar\ folder for new tar.gz archives.
  • When a new 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 for the name of detected archive.
  • The Unzip Files Action extracts all files from the 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 in the C:\Zip\ folder.
  • The Delete File Action automatically deletes all the content of C:\Uncompressed\ for the next Task execution.

Create 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 Windows process automation application. Irrelevantly whether you choose the New Task option from File menu, use CTRL+N shortcut, or right-mouse click in the Task Pane, it will open the Task Wizard in the Welcome tab.

Task Wizard · Welcome
Task Wizard · Welcome

Folder Watcher

Adding the File & Folder Watcher 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
File & Folder Watcher

Once in File & Folder Watcher, let's set up 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
Monitor C:\Tar folder

Second, let us specify that the File & Folder Watcher monitors only for Tar.gz files. Specify the Include mask 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.

Unzip files

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
Add Unzip Files Action

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
File 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 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
Unzip files to C:\Uncompressed\ folder

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.

Zip files

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\*.*
Zip all files in C:\Uncompressed\ folder

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
File 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.

Files · C:\Uncompressed\*.* to C:\Zip\[Filename]
Zip all files in C:\Uncompressed\ folder

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
Encrypt archive with 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.

Clear folder

Adding the Delete File Action to delete the contents of the folder. Let us add the Delete File 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\*.*
Delete all files in C:\Uncompressed\ folder

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
Task structure with 3 Actions

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.

Task execution policy

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
Task Properties

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

Task Wizard · Finish
Task Wizard · Finish

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
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.

Summary

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 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.

Notes

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.

Technical details

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 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.
  • Extract 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.

Recap

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:

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

Assistance is here…

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