Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

7-zip command lines to add password-protection to unprotected zip file

Suppose I already have an existing zip file Unprotected.zip. I want to add password protection to Unprotected.zip. I want to use 7-zip command-line version to accomplish this task. How should the 7-zip command lines look like to achieve this goal?

like image 686
guagay_wk Avatar asked Nov 20 '25 05:11

guagay_wk


1 Answers

I think there is no one-step solution to do this. We have to extract the zip file, and then pack it to zip file. For example:

7z e Unprotected.zip

7z a Protected.zip -pPASSWORD UNPROTECTEDFILENAME

Replace the capital letters into your own string.

Refer to Add Set-Password

like image 108
helpdoc Avatar answered Nov 22 '25 03:11

helpdoc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!