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.

Hucker
  • 671
  • 1
  • 8
  • 25

2 Answers2

13

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

7z.exe a -mhe=on -pPassword "..\sot.7z"
MC ND
  • 69,615
  • 8
  • 84
  • 126
1

I did this, and it did work:

7z.exe a -psecret -mhe=on C:\newfolder\a.7z "C:\folder1\back-this-up"
marikamitsos
  • 10,264
  • 20
  • 26