Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command line 7zip issues when encrypting headers

I'm creating an zip file using 7zip from the command line during my build process. using a command like this:

7z.exe a -pPassword "..\sot.zip" .

This command works correctly and I'm able to see an encrypted file as expected. Now when I add the capability to encry0pte the headers

7z.exe a -mhe=on -pPassword "..\sot.zip" . 7z.exe a -mhe+ -pPassword "..\sot.zip" .

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning

Creating archive sot.zip

System error:
The parameter is incorrect.

I get "The parameter is incorrect." errors regardless of where I put them on the command line.

Is there a way to perform the encryption of headers from the command line.

like image 484
Hucker Avatar asked Jul 18 '26 23:07

Hucker


2 Answers

-mhe is not supported in .zip files. For it to work, use .7z format

7z.exe a -mhe=on -pPassword "..\sot.7z"
like image 150
MC ND Avatar answered Jul 21 '26 04:07

MC ND


I did this, and it did work:

7z.exe a -psecret -mhe=on C:\newfolder\a.7z "C:\folder1\back-this-up"
like image 38
user13041529 Avatar answered Jul 21 '26 03:07

user13041529



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!