Syntax:
-add archive {options} +file {-file}


Overview:
This command lets you compress files and folders in an archive; if the specified archive already exists, files and folders will be added to that.
Not all archive formats allow files compression: you can create ZIP, ZIP-based, TAR, TAZ, TGZ, TAR.GZ, TAR.BZ2, SQX, CAB archives. You can tell the program which format you want to compress to by specifying the filename extension of the archive, so "test.zip" will create a ZIP archive, while "test.cab" will create a .CAB one.


Options:

+ (file/folder)
 

Adds file/folder to archive: you must specify at least one file/folder to compress.

You can use wildcards ( * or ? ) to add a group of files that are of the same file type or that have similar file extensions.
A command line with the "-add" command can have multiple "+" parameters so you can add multilple files and folders at once.

Example.:
+*.* (adds all files)
+file1.txt (adds only file1.txt)
+"C:\My Documents\*.doc" (adds all .DOC files in My Documents folder)

See other examples below.

- (file/folder)
 

Ignore files and/or folders.

When you use the "-add" command to perform a massive compression operation that involves groups of files and/or folders, you may want to exclude some file or folder from being compressed by using the "-" parameter.
You can use wildcards ( * or ? ) to specify which file(s) and folder(s) should be ignored by ZipGenius while compressing. A command line with the "-add" command may have multiple "-" parameters in order to exclude multiple files/folders, but you must use at least one "+" parameter in the same command line.

Examples:
-*.* (all files)
-file1.txt (only the specified file)
-"C:\My Documents\*.doc" (all .DOC files in My Documents folder)

See other examples below.

@ (file list)
 

This option lets you specify which files and/or folders should be compressed through a list stored in a text file.
The "@" parameter is used to indicate the full path and name of the file that must be read by ZipGenius; the text file that will hold the list uses the "+" and "-" parameters as described above.

Ecamples:
@"c:\My Documents\mylist.txt"
where "mylist.txt" holds the following list:
+"C:\Test\*.*"
-"*.txt"
-"*.tmp"
-"*.jpg"

C [0 | 1 | 5 | 9 | B ]

 

Sets the compression level.
Default value is C0, which will automatically be selected if "C" option is not specified in the command line.

"C" must be associated to one of the following values:

  • 0 - no compression
  • 1 - low compression, max speed
  • 5 - medium compression and speed
  • 9 - max compression, low speed
  • B - "brutal" compression, lowest speed

Example:
zg -add test.zip C9 +*.doc
Max compression level will be applied.

A [ A | M | U ]
 

Sets compression mode.

  • AA - adds files to archive
  • AM - moves files to archive (original files will be deleted after compression)
  • AU - updates existing files in the archive.

The default value is AA, which will be used if the "A" parameter won't be specified in the command line.

P [ Password | 0 ]

 

Protects files with a password.

The default value is P0, which means that files will be added to archive without being protected with a password; a password will be applied only if you will specify one after the "P" parameter. See the example:

Pthisismypassword

"thisismypassword" will be used to protect the files you are going to add through the command line.

F [ 0 | 1 | 2 | 3 ]
 

Tells the program how it should save the path of files being compressed.

The "F" parameter may assume one of the following value:

  • 0 - just stores filenames without path info
  • 1 - stores relative path
  • 2 - stores full path without disk drive letter
  • 3 - stores full path including disk drive letter

The default value F1, which is used when the "F" parameter is not specified in the command line.
The F3 option must be used very carefully, because it is useful just when you need to perform a real backup of files and folders: when you will extract files and folders that were stored using the F3 option, the program will ignore any destination folder you will indicate and it will re-create the entire path on your hard disk, just starting from the disk drive letter. This options also may be not compatible with other compression utilities.

R [ 0 | 1 ]

 

Sets program behaviour with subfolders while compressing files.

"R" may assume one of the following value:

  • 0 - ignore subfolders
  • 1 - include subfolders

Default value is R0 and it is used when the "R" parameter is not specified in the command line.

K [ 0 | 1 ]
 

Shows a progress indicator while performing an action.

"K" may assume one of the following values:

  • 0 - no indicator
  • 1 - indicator is visible

Default value is K1 and it is used when the "K" parametere is not specified in the command line.

I [ 0 | 1 ]

 

Sets the program to remove the A (archive) attribute from file being compressed.

"I" may assume one of the following values:

  • 0 - attribute not removed
  • 1 - attribute removed

The default value is I0, which is used when the "I" parametere is not specified in the command line.

D [ A | H | R | S | F | Z | X ]
 

Tells the program to include only the files that have the specified attributes among those selected for compression.

"D" parameter may assume one or more of the follwoing values:

  • A - archive file
  • H - hidden file
  • R - read-only file
  • S - system file
  • F - folder
  • Z - file without attributes
  • X - file with any attribute (except folders)

The "D" parameter can be followed by a combination of the switches described above, so you can force the program to consider files with different attributes at once. Example: DAHDHZDARS and so on.

The default value is DX, which is used when the "D" parameter is not specified in the command line.

V [ A | { volume size } ]


 

Creates a multivolume archive on a set of removable media; the size of each volume may be automatically calculated upon the destination media capacity, but you can force the program to write volume with a specific size by using one of the following switches after the "V" parameter::

  • A - volume size automatically calculated
  • vm720 - 720 KB circa
  • vm880 - 880 KB circa
  • vm1440 - 1.44 MB circa
  • vm2880 - 2.88 MB circa
  • vmEmail - 250 KB
  • vmWeb - 750 KB
  • vmCDR650 - 650 MB circa
  • vmCDR700 - 700 MB circa
  • vmCDR800 - 800 MB circa
  • vmDVD5 - 4.7 GB circa
  • vmDVD9 - 8.5 GB circa

Remember: if you are going to save volumes on optical media like rewritable CD-ROMs or DVD-ROMs, you must format them with the UDF filesystem.

If the "V" parameter is not specified, no volume will be created.

S [ A | { volume size } ]

Creates an archive and splits it into smaller files. The file parts will be created on your hard disk, so you will be free to choose what to do with those files. The size of file parts is automatically calculated upon or you can choose a file size by specificing one of the following switches after the "S" parameter:

  • A - size is automatically calculated
  • sm720 - 720 KB circa
  • sm880 - 880 KB circa
  • sm1440 - 1.44 MB circa
  • sm2880 - 2.88 MB circa
  • smEmail - 250 KB
  • smWeb - 750 KB
  • smCDR650 - 650 MB circa
  • smCDR700 - 700 MB circa
  • smCDR800 - 800 MB circa
  • smDVD5 - 4.7 GB circa
  • smDVD9 - 8.5 GB circa

E

Creates a self-extracting archive.

Just specify this parameter to get a .zip archive converted to .exe.

O

 

Creates an archive and lets you specify options through a dialog. Just specify this parameter in a command line to force the program to show the compression options dialog, that will let you set additional options through a visual interface.

 


 

Note:
You can create archives only in the following formats:

  • ZIP
  • JAR
  • WAR
  • EAR
  • WMZ
  • WAL
  • DSFZ
  • BSZ
  • PCV
  • MSKIN
  • SXW
  • SXC
  • SXD
  • SXI
  • XPI
  • STW
  • STC
  • STD
  • STI
  • CBZ
  • CAB
  • SQX
  • TAR
  • TAZ
  • TGZ
  • TAR.GZ
  • TAR.BZ2
  • RPM
  • GZ
  • Z
  • BZ2

Also, remember that not akk the options are available to all formats that support file compression: when you use an unsupported option with a given archive format, that option will simply be ignored.
 

 

 

Examples:

1) zg -add "C:\My Folder\Test.zip" +*.*
This is the minimum set of parameters required by the "-add" command.

2) zg -add test.zip +*.* -*.doc -?.txt
Test.zip will be created in the current folder and it will contain all files stored in the same folder, except all .DOC files and any file with the .TXT extension. All other default settings will be used.

3) zg -add test.zip CB +*.* -*.doc -?.txt
Like previous example, but here we are going to apply BRUTAL compression level.

4) zg -add test.zip R1 +*.* -*.doc -?.txt
Like example (2) but this time we need to compress subfolders, too.

5) zg -add test.zip R1 +*.* -*.doc -?.txt -\SubFolder1\*.*
Like example (4) but we want to exclude the whole folder "SubFolder1" from being compressed.

6) zg -add test.zip C5 R1 +"C:\My Folder\*.*"
Test.zip will be written to current folder and MEDIUM compression level will be applied. Also we would like to compress ll files and subfolder in C:\My Folder\ with their relative path (default value, so no parameter is specified).
Test.zip will have this file list:

file1.txt
file2.txt
file3.txt
SubFolder1\file_a.doc
SubFolder1\file_b.doc
SubFolder1\file_c.doc
SubFolder1\SubFolder2\file_A.doc
SubFolder1\SubFolder2\file_B.doc
SubFolder1\SubFolder2\file_C.doc


7) zg -add test.zip C5 R1 F2 +"C:\My Folder\*.*"
Like example (6) but this time we want to store the same files together with their full path, so F2 parameter is specified.
Test.zip will have this file list:

My Folder\file1.txt
My Folder\file2.txt
My Folder\file3.txt
My Folder\SubFolder1\file_a.doc
My Folder\SubFolder1\file_b.doc
My Folder\SubFolder1\file_c.doc
My Folder\SubFolder1\SubFolder2\file_A.doc
My Folder\SubFolder1\SubFolder2\file_B.doc
My Folder\SubFolder1\SubFolder2\file_C.doc

8) zg -add test.zip C5 R1 @"C:\Folder 1\Files.txt"
Like example (6) but this time we want to compress the files and folders specified in a text file stored in the hard disk as C:\Folder 1\Files.txt, which looks like:

C:\Folder 1\Files.txt

+*.*
-*.doc
-*.gif
-*.txt
+"C:\Folder 2\*.bmp"

The "@" parameter is useful when you need to repeat tasks using always the same options with a file list that may be differ from time to time.


Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor