Console mode

Control zipcreator from the command line.

Console mode basics

When you start zipcreator from the command line, you can also specify arguments to create or update zip files automatically. This also applies to starting zipcreator from a shortcut, alias, batch file or shell script.

Starting zipcreator from the command line

Use the following command to start zipcreator.

java -jar zipcreator.jar

This tells the Java application launcher to start zipcreator. This is the console equivalent of double-clicking on the zipcreator.jar executable.

The following optional arguments can be appended to the syntax for starting zipcreator. Note that arguments should be specified using the same order as presented below.

-font [small | medium | large]
Set the initial font size.

-compression [faster | normal | stronger]
Determines the compression level when saving zip files.

-norestrict
Enables clipboard and drag operations on Mac OS, which are disabled by default.

<zip path>
The path of an existing zip file to open.

-add <files>
Adds the specified <files> as entries, separated by spaces. You can specify directories to include all their contents.

-save
Saves the opened the zip file.

-saveas <zip path>
Saves the zip file using the specified path.

-exit
Exit the application after saving.

Using wildcards

To include all files of a certain type, use an asterisk (*) character as a wildcard. For example, to add all PNG files from a Photos directory, use -add "Photos/*.png"

To extend the scope to include subdirectories, use two asterisks (**).

Some console environments automatically replace wildcard arguments with specific files. To prevent this, you can enclose wildcard arguments in quotation marks.

User interaction

While console mode is designed to operate automatically, some degree of user interaction may be necessary. For example:

If you enter invalid arguments or the argument sequence is incorrect, an error message is displayed. Errors are typically caused by invalid file paths. Paths containing spaces in directory or file names should be enclosed in quotation marks.

If you are adding entries which already exist in an opened zip file, you will be asked to confirm their replacement.


Examples

Open an existing zip file

This example starts zipcreator and opens Sketches.zip file in the Recent work directory. Notice the use of quotation marks to enclose paths containing spaces.

java -jar zipcreator.jar "C:\Recent work\Sketches.zip"

Add directories

This example will add the contents of the Recent work and Correspondence directories. The zipcreator window will be displayed, so that the contents can be reviewed and saved manually.

java -jar zipcreator.jar -add "C:\Recent work" "C:\Correspondence"

Backup a directory

This example adds the contents of the C:\Database directory to a new zip file called DB.zip. The -exit switch tells zipcreator to exit on completion.

java -jar zipcreator.jar -add "C:\Database\data" -saveas "C:\DB.zip" -exit


Next: Integrating zipcreator