Purpose:Add, update, or delete files in a .7Z archive

 

Format:7ZIP [/= /A:[[-][+]rhsdaecjot] /A /C /CRC /D /F /Kn /Ln /M /O:[-]acdeginorstuz /P /Q /R /S"password" /T /TEST /U /V] ziparchive [@file] file...

 

ziparchiveThe 7zip file to work with
fileThe files(s) to be added to the 7zip file

 

/A:... (attribute switch)/P(rogress)
/A(dd)/Q(uiet)
/C(ontents)/R(ecurse)
/CRC/S"password"
/D(elete)/T (save attributes
/F(reshen)/TEST
/Kn (compression method)/U(pdate)
/Ln (compression level)/V(iew)
/M(ove)
/O:... (sort order)

 

File Selection

 

Supports command dialog, attribute switches, extended wildcards, ranges, multiple file names, and include lists.

 

File Completion Syntax:

 

The default filename completion syntax is: [1] dirs 7z [2*] *

 

Usage:

 

You can specify a pathname for ziparchive. If you don't provide an extension, and the filename as entered doesn't exist, 7ZIP adds ".7z". If you don't specify an operation, 7ZIP will default to Add. If you don't specify any arguments, 7ZIP will display its command dialog.

 

7ZIP supports connected web folders. If an HTML file (i.e.,  with an .htm or .html extension) is zipped, 7ZIP will look for a  folder in the same directory with the same name and an extension of ".files". If it is found, the .files directory will be added to the 7ZIP archive.

 

7ZIP sets two internal variables:

 

%_7zip_filesThe number of files archived
%_7zip_errorsThe number of errors

 

Options:

 

/=Display the 7ZIP command dialog to help you set the filename and command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/A:...Select only those files that have the specified attribute(s) set. See Attribute Switches for information on the attributes which can follow /A:. Do not use /A: with @file lists. See @file lists for details.

 

You can specify /A:= to display a dialog to help you set individual attributes.

 

/AAdd the specified file(s) to the zip file. (This is the default.)

 

/CDisplay (on standard output) the contents of a file in the zip archive.

 

/CRCDisplay the file CRCs (must be used with /V).

 

/DDelete the specified file(s) from the zip file.

 

/FUpdate only those files that currently exist in the 7zip file, and which are older than the files on disk.

 

/KnSet the compression method.

 

0LZMA
1BZip2
2Delta
3Copy (no compression)
4Deflate
5LZMA2 (default)

 

/LnSet the compression level (1 - 5, where 1=minimum compression, and 5=maximum compression). The default is 2.

 

/MDelete the files from the disk after adding them to the 7zip file.

 

/O:...Sort the files before processing.

 

You may use any combination of the sorting options below. If multiple options are used, the files will be sorted with the first sort option as the primary key, the next as the secondary key, and so on:

 

nSort by filename and extension, unless e is explicitly included. This is the default.
-Reverse the sort order for the next sort key
aSort names and extensions in standard ASCII order, instead of numerically when numeric substrings are included in the name or extension.
cSort by compression ratio
dSort by date and time (oldest first); also see /T:acw
eSort by extension
gGroup subdirectories first, then files
iSort by description
oSort by owner
rReverse the sort order for all options
sSort by size
tSame as d
uUnsorted
zSame as s

 

/PDisplay the progress (0 - 100%) for each file as it is zipped.

 

/QDon't display the files being zipped.

 

/RIf the argument is a subdirectory, copy all of the files in that subdirectory and all of its subdirectories to the zip file.

 

/SUse the specified password to encrypt the file(s). If you don't provide a password on the command line, 7ZIP will prompt you to enter one.

 

/TSave the file attributes (they will be set when the file is extracted).

 

/TESTTest the integrity of the 7ZIP file (header and contents). Any errors will be displayed on STDERR.

 

/UUpdate files which either don't exist in the 7zip, or which are older than the files on disk.

 

/VView the list of files in the 7zip file (date, time, size, and filename). If the 7zip file is password protected, 7ZIP will append a * after the filename.