RPA — How to password protect Zip file using 7-zip in UiPath
In this tutorial, I will show how to password protect zip file using 7-zip installed in the Bot machine.
What is 7-zip
7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as “archives”. It is developed by Igor Pavlov and was first released in 1999. 7-Zip has its own archive format called 7z, but can read and write several others.
Password works in two different ways for zip file:
1. Files inside zip folder are password encrypted: In this approach, anyone can open zip folder and unzip it but could not open the files without password.
2. Encrypted Zip folder with password protect : In this approach, zip folder is password protected. But it does not work with .zip extension. It works with .7z extension incase of 7-zip.
Password protect (.zip) file:
Use the below command in Start Process activity:
In FileName : Path for 7z.exe
i.e. “C:\Program Files\7-Zip\7z.exe”In Arguments : Path for the file and zip folder name. a <Zip Folder path> -p<Password> <Path of the file to be zipped>
i.e. “a d:\trest.zip -p1234 C:\Users\santa\Desktop\Test\Test.txt”
Encrypted Zip folder with password protect:
Use the below command in Start Process activity:
In FileName : Path for 7z.exe
i.e. “C:\Program Files\7-Zip\7z.exe”In Arguments : Path for the file and zip folder name. a <Zip Folder path> -p<Password> <Path of the file to be zipped> -mhe
i.e. “a d:\trest.7z -p1234 C:\Users\santa\Desktop\Test\Test.txt -mhe”
Happy Automation !!
Follow me on LinkedIn: https://www.linkedin.com/in/santanbarnwal/
Subscribe to my YouTube channel: https://www.youtube.com/channel/UCoF8-B_MfOCL40szrorbtyQ
My Website: www.santanbarnwal.com
— Santan Barnwal