Other Free Tools zip - A command line tool to create a zip file v1.0

zip - A command line tool to create a zip file v1.0 2023-10-12

Download zip (56.1 KB)

This is a zip compression tool that is simply wrapped with zlib libraries and does not rely on other third-party DLLs.

Command Line

zip [file1] ... [filen] [dir1] ... [dirn] -s -v:file -o:[zip file=""]
  -s      include subdir/subfiles
  -v:file read file version, used to replace output file
  zip demo.exe demo -o:demo.zip
  zip demo.exe demo -v:demo.exe -o:demo_%d.%d.zip

For the file path in the zip, use a similar method as WinRAR -EP1: Switch -EP1 - exclude base folder from names That is, after removing the parent directory of the input file, the remaining part is used as the path in the zip.
For example: Suppose c:\foo\has:


c:\foo\a.fb      => a.fb
c:\foo\*.fb      => a.fb
c:\foo           => foo/a.fb

-o: Specify the zip output file name after it, or use unname to .zip if not specified
the output file name can contain *? Wildcards, such as:
  c:\foo*.bat will add .bat files under c:\foo,
  c:\foo\??.txt will add all 2 letters under c:\foo


// Compress the zipdemo and subdirectories into the demo .zip
zip.exe zipdemo -s -o:demo.zip