FAQ     Assistance aux utilisateurs     Command Line          
JZIP command line:
This document describes the various commands and switches available, for using jzip in "command-line" mode.
This document is divided into three sections.
Section 1 contains the most basic and common commands.
Section 2 contains the more advanced commands and switches.
Section 3 (or appendix), contains an explanation regarding the "listfile" command.

The complete list of commands and switches can be viewed by typing "jzip -h" or "jzip -?" from the command prompt window (or the "run" dialog").
Section 1: Basic commands:

In general, all command-line usage goes as follows:
"jzip <command> <archive name and extension> <path> <files to add\extract>"

  • Elements in [brackets] are optional.
  • Options are introduced by either a hyphen ["-d"] or a forward slash ["/d"].
  • Multiple options must be separated by one or more spaces ("-d -n", not "-d-n").
Command Description Example
-a Add files to archive jzip -a test.zip *.txt
adds all the *.txt files in the current folder to test.zip
-d Delete specified file(s) from the Zip file jzip -d d:\temp.zip license.txt
Removes the file license.txt from the temp.zip file
-m Move files to the Zip file (the files are then deleted from disk) jzip -m d:\temp\test.zip *.*
Move all files in current folder to test.zip (original files are deleted from system)
-s[password] Specify a password (if no password is given, a prompt will be generated). jzip -spassword d:\temp\test.zip *.*
add all files in current folder into test.zip with password being "password".
-u Update (add files that are new or have changed) jzip -u d:\temp\test.zip *.*
adds only new or updated files (found in the current folder) to test.zip
-x Exclude specified file(s) from the zipping process jzip -x*.txt d:\temp\test.zip *.*
Creates test.zip and includes all files in the current folder except .txt files.
-e Extract files from archive jzip -e test.zip
Extracts all files from Test.zip to the current directory
Section2: Advanced commands and switches:
-ed Extracts all files from archive, recreating the directory structure from folder information, stored in the Zip file. Jzip -ed test.zip
-et test the archive file integrity, without extracting files. jzip -et c:\documents\file.zip
This command will test the integrity of the Zip file c:\documents\file.zip.
-eo Overwrite files, without asking for confirmation. Jzip -eo c:\documents\docs.zip
This command extracts all files from docs.zip and overwrites files in current directory if needed.
-e- Don't overwrite files. Jzip -e- c:\windows\archive.zip
This command doesn't overwrite files in current directory.
-es Skip older files Jzip -es c:\documents\letters.zip
This command extracts only newer files, skipping older ones.
-a+ Remove the archive attribute from each file after adding it to the Zip file jzip -a+ test.zip *.txt
adds all the *.txt files in the current folder to test.zip and then resets the archive attribute
-b[drive|path] Use another drive for the temporary Zip file. This option enables you to use another drive for that purpose when space considerations force the issue jzip -bd:\temp test.zip c:\temp\*.txt
-l<d | e | b><0-5> Sets a compression method and level, when adding files to archive. Use [d] for Deflate, [e] for Enhanced or [b] for Bzip2 algorithms. Use 0-5 to set compression level. 5 = maximum compression; 0 = no compression jzip -le5 d:\temp\test.zip *.gif
Adds all .gif files in the current folder to the test.zip file, using the enhanced deflate method with maximum compression.
-f Freshen.
replace any files already included in the archive, which are newer on disk. (Note that Files must have the same name, in order for the "freshen" command to work).
jzip -f d:\temp\test.zip *.txt
Replaces any .txt files that are currently in test.zip with the newer .txt files found in the current folder.
-u Update.
This command adds to the Zip file any files that are not already in the Zip file, and replaces any files that have a more recent date on disk. (this command is the same as -a (Add) except that it skips files that are already in the Zip file and have the same date in the Zip file and on disk)
jzip -u d:\temp\test.zip *.*
Used to update existing Zip files. The above adds new files or updated files found in the current folder to test.zip. If a file currently exists in the Zip file, only add it if the date on disk is newer than the date of the file in the Zip file.
-i[-] Add files whose archive attribute is set. the archive attribute is then removed. (Use the optional "-" suffix to leave the archive attribute on) jzip -i d:\temp\test.zip *.txt
Adds all *.txt files found in the current directory, that have their archive attribute set, to test.zip. then remove the archive attribute from the *.txt files.
-whs Include hidden and system files in the zipping process. jzip -whs d:\temp\test.zip *.*
Zip all files in the current folder including system and hidden files.
-Whs Exclude hidden and system files from the zipping process (default). jzip -Whs d:\temp\test.zip *.*
Zip all files in the current folder except system and hidden files.
-jhrs Do not store hidden, read only, and system attributes in the Zip file. jzip -a -jhrs d:\temp\test.zip *.*
Add all files in the current folder, EXCEPT hidden and system files, to the test.zip. Hidden, system and read-only attributes are not maintained on files added to the Zip file.
-Jhrs Store hidden, read only, and system attributes in the Zip file (default). jzip -a -Jhrs d:\temp\test.zip *.*
Add all files in the current folder to test.zip, EXCEPT hidden and system files, in the current folder to test.zip. Maintain the read only attribute if applicable.
-k Do not update the Zip file's file date. (retains the original date) jzip -a -k d:\temp\test.zip *.*
Add all files in current folder to test.zip (existing Zip file), and maintain original file date.
-m[f|u] An enhanced version of the basic "Move" command.
When the "Freshen|Update " operation is complete, the original files are deleted.
jzip -mf d:\temp\test.zip *.*
- If file exists in test.zip and date is newer on disk then move file to test.zip.
- If file exists in test.zip and date is older or the same on disk then just delete file from disk.
- If file does not currently exist in test.zip, ignore it.

jzip -mu d:\temp\test.zip *.* Move all files to test.zip. Those files that already existed in test.zip and are newer on disk, update those files. Any new files found in the current folder are also moved to test.zip. Files on disk are deleted.
-p or -P Store folder names.
A lower case p stores only the names of folders (subfolders included) via the -r option, while an upper case P stores all folder information specified on the command line or in the listfile. (Use with the -r option).

For example we have the folder structure:
Level1\a
Level1\b

Level1 contains one file file1.txt
Level1\a contains two files a1.txt and a2.txt
Level1\b contains two files b1.txt and b2.txt
jzip -p -r d:\temp\test.zip d:\level1\*.*
This creates test.zip with file1.txt, folder level1\a and files a1.txt and a2.txt and folder level1\b with files b1.txt and b2.txt. (Note the folder level1 itself does not get included). When test.zip is extracted you get this structure in the folder you extract to:
File1.txt
Levela\a1.txt
Levela\a2.txt
Levelb\b1.txt
Levelb\b2.txt


jzip -P -r d:\temp\test.zip d:\level1\*.*
This creates test.zip with folder level1 and file file1.txt, folder level1\a and files a1.txt and a2.txt and folder level1\b with files b1.txt and b2.txt. When test.zip is extracted you get this structure in the folder you extract to:
Level1\file1.txt
Level1\Levela\a1.txt
Level1\Levela\a2.txt
Level1\Levelb\b1.txt
Level1\Levelb\b2.txt
-T [date] Include files older than the date specified. (current date is used, if no date specified) jzip -t20030902 d:\temp\test.zip *.*
Add all files in current folder to test.zip, that have a date equal to or more recent than 2003, September 02.
Appendix: "listfile" command:

A "listfile" is a pre-made TXT file, which contains a list of files to be extracted from an archive.

A listfile is line-based, where each line can contain only one filename.

Filenames may also include wildcards. The wildcard specification "*" is assumed to mean "*.*", i.e., all files.

The listfile can also contain comments, indicated by a semicolon. any text following a semicolon (';') is ignored, up to the end of the line.



To use the listfile command, type the following:
jzip -e <location and name of filelist> <path to extract files>
For example, we have an archive file, named "MyArchive.zip".

This archive contains many files, of various types, such as DOC, JPG, TXT, PDF, EXE, etc. we can use the basic extract command, "-e", to extract the files, but this will extract ALL files from the archive. on the other hand, we can create a listfile, in which we specify exactly which files we want to extract from the archive.



we create a TXT file, named "mylistfile.txt". the file contains the following line:
; List of files to extract
info.doc
cat.jpg
cat2.jpg
*.txt ; Extract all .txt files

We then run the following command:
Jzip -e MyArchive.zip @mylistfile.txt c:\temp
This command extracts only the specified files in the listfile (docs, jpgs, txts), and puts them in the c:\temp folder. Any other files are skipped and aren't extracted (pdf, exe, etc.)