Robots don't have built in steps that would zip/unzip files. But this can be done using a third party utility that has command line parameters to zip/unzip.
The example below uses 7-zip but, in a similar way, any other utility can be used.
Install 7-zip on the machine where Design Studio is (to be used when building and testing the robot) and on all RoboServers where the robot would run.
To zip files
- In the robot add an Execute Command line step
- in the step configuration enter the following command in the "Command line" field:
<7-zip Installation folder>\7z a -tzip <target archive location> <source file/folder
E.g. "c:\Program Files\7-Zip\7z.exe" a -tzip C:\Temp\Output.zip C:\Temp\SourceFile.txt
To unzip files
- In the robot add a Write File step to write a bat file, e.g. C:\Robots\Unzip.bat
- File content should be
cd <location of the archive file>
"C:\Program Files\7-Zip\7z.exe" e <the archive file>
"C:\Program Files\7-Zip\7z.exe" e Output.zip
- In the robot add an Execute Command line step and configure it to launch the bat file created at step 1.