Unzip files

Uncompresses files from a ".zip" file to the directory inserted in the script.

Command availability: IBM RPA SaaS and IBM RPA on premises

Script syntax

unzip --file(String) --destinationfolder(String) [--filemask(String)]

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
File file Required Text Path to the ".zip" file that should be unzipped.
Destination directory destinationfolder Required Text Destination directory the file will be extracted to.
File filter filemask Optional Text Filter that will be applied in the search. It must be inserted as follows: [Name or part of the file name, spaces are not accepted in this part].[File extension].

Note:When entering the name of the file, it must be case sensitive.


After obtaining the "Desktop" directory with the Get System Folder Path command, the Create Directory command creates a directory called "Test Folder", and the Unzip files command unzips ".txt" files from a ".zip" to the created directory.

defVar --name desktop --type String
defVar --name createdDirectory --type String
getSpecialFolder --folder "Desktop" desktop=value
createDir --path "${desktop}\\Test Folder" createdDirectory=value
unzip --file "testFileIBM.zip" --destinationfolder "${createdDirectory}"
logMessage --message "Directory where the unzipped file was saved: ${createdDirectory}" --type "Info"
// The "logMessage" command displays the path to the directory where the unzipped file was saved.