Command line 7zip issues when encrypting headers
Asked Answered
B

2

7

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.

Barque answered 11/11, 2014 at 21:7 Comment(0)
J
14

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

7z.exe a -mhe=on -pPassword "..\sot.7z"
Justis answered 13/11, 2014 at 10:24 Comment(0)
E
1

I did this, and it did work:

7z.exe a -psecret -mhe=on C:\newfolder\a.7z "C:\folder1\back-this-up"
Ease answered 10/3, 2020 at 20:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.