PDA

View Full Version : Make zip from command line


Masquerade
17-04-2021, 07:19
How do I make a simple zip file through 7z command line?

I am trying to replicate these settings:
https://i.ibb.co/XZqjpLd/Capture.png

I tried:

7z a -bt -bb3 -mx=7 -mm=deflate outfile infile

However this still makes a 7z archive as shown by this hex editor screenshot:
https://i.imgur.com/5d3sW0V.png

It should look like this:

https://i.imgur.com/IPurqll.png

KaktoR
17-04-2021, 08:00
You can use tar.exe from windows itself

tar.exe -cf Archive.zip <InputDir>

Masquerade
17-04-2021, 10:06
You can use tar.exe from windows itself

That does not create an archive as specified in the second hex edit screenshot.

ffmla
17-04-2021, 10:14
That does not create an archive as specified in the second hex edit screenshot.
had some doubts..
Decoded text shows PK & 7z is it the identifier..
EDIT:
Clarified.!

Cesar82
17-04-2021, 10:17
How do I make a simple zip file through 7z command line?

I am trying to replicate these settings:
https://i.ibb.co/XZqjpLd/Capture.png

I tried:

7z a -bt -bb3 -mx=7 -mm=deflate outfile infile

However this still makes a 7z archive as shown by this hex editor screenshot:
https://i.imgur.com/5d3sW0V.png

It should look like this:

https://i.imgur.com/IPurqll.png

You must enter the zip format type on the command line.
I don't know if this resolves, take the test.

7z a -tzip -bt -bb3 -mx=7 -mm=deflate outfile infile

ffmla
17-04-2021, 10:18
^^Solved...!
if u used tzip.

Masquerade
17-04-2021, 10:57
I don't know if this resolves, take the test.

7z a -tzip -bt -bb3 -mx=7 -mm=deflate outfile infile
Brilliant :D thanks very much!

This makes the correct file.

Joe Forster/STA
17-04-2021, 12:49
Why not use Info-ZIP (http://infozip.sourceforge.net) instead? That's the open-source ZIP implementation.