General Discussions

Discuss any topics that are not product-specific here.

Zip Output Folder Using WinZip from an Event/RunCommand

mariahmeehan
7 - Meteor

Hello,

I am trying to zip a folder, which is the output of the workflow, each time it is run. I read about using a Run Command tool or event along with a batch script but can only find a batch script that does it using 7Zip (which my users won't have). Does anyone know what the bat lines would be to do this with WinZip?

Thanks,

Mariah

2 REPLIES 2
PaulN
Alteryx Alumni (Retired)

Hi @mariahmeehan,

 

I have found the following script on the WinZip help pages. Is that what you are looking for?

 

REM create list of directories
CD C:\[PATH1]
DIR /AD /B >dirlist.txt

REM Zip contents of each directory
for /f "tokens=*" %%a in (dirlist.txt) do (
  CD "%%a"
  wzzip "C:\PATH2\%%a.zip"
  CD..
)

 

Source: https://support.winzip.com/hc/en-us/articles/115011641387-Create-individual-Zip-files-with-a-command... [section: Individual Zip files of folders]

 

In your workflow, you would have to pass the paths (C:\PATH1 and C:\PATH2 if relevant).

 

Hope that helps.

 

Paul Noirel

Sr Customer Support Engineer, Alteryx

 

mariahmeehan
7 - Meteor

Hi Paul,

This is close. I'm looking to zip a specific folder (the "Outputs" folder from the workflow after it is run). This script zips all directories inside a folder (which I guess would be fine and I could just filter for the Outputs folder but seems like there may be a way to do just one folder). I've been trying to build off what you sent me but have had no luck so far. I'll keep trying but if you have any suggestions that would be greatly appreciated.

Thanks so much!

Labels