ALZip

Command Line

Top  Previous  Next     ESTsoft Corp.

al_mic Command line compression and extraction with ALZip

ALZip supports command line compression for ALZ and ZIP files and extraction for all supported archive file types. You can easily automate repetitive tasks with batch scripts or shell calls to ALZip with your own custom software tools. (Note: The command line functionality in ALZip is not currently completely silent.)

<Command line structure in ALZip>

There are 5 basic parts to the command line:

Invoke ALZip

Add / Extract

argument

Command Switches

Source files

Target (*Optional)

alzip

-a

-[sfx|t|d|b|si#|off|

p$|af|v#|m#|an$]

<drive>:\<path>[\<filename>]

[,<drive>:\<path>[\<filename>]...]

[<drive>:\<path>[\<filename{.zip|.alz}>]]

-x

-[b|off|xr|xf|xn]

<drive>:\<path>\<filename>

[,<drive>:\<path>\<filename>...]

[<drive>:\<path>\]

Invoke ALZip: This tells Windows to run ALZip with the parameters that follow. ALZip is automatically added to your system path when installed. If you don't know what that means, it means ALZip will work properly without any additional effort from you :-)

Add / Extract argument: This tells ALZip whether to add files to a new archive or extract from an existing archive. Not specifying the file(s) when adding will add an entire directory and its contents (like "*.*"). You must always specify the file name when extracting. You can extract different archive formats like ZIP, ALZ, and RAR all at the same time with a comma separated list of archives, e.g. alzip -x file1.zip,file2.rar,file3.alz.

Command switches: These allow you to modify the default add/extract behaviour and perform other tasks. See below for an explanation of each switch with examples.

Source files: Specify the file(s) you wish to add or extract. Separate additional files after the first with a comma and NO SPACE. You must specify the path to the files if they are not in the same directory.

Target: This is optional. Specify the path and file name. ALZip will automatically date stamp the file name if you do not specify a file name.

 

ball_small Syntax definitions for command line compression and extraction:

 

egg_violet Source

With "-a", file(s) to add to a new ZIP or ALZ archive file.

With "-x", file(s) to extract

egg_violet Target

With "-a", an already existing complete path and file name with .zip or .alz compressed archive file extension

With "-x", a complete path that may or may not already exist

egg_violet <drive>

Disk drive source file(s) are on.

With "-a", disk drive for target path and file name.

With "-x". disk drive for target path.

* Network drives are supported for -a and -x, use the normal "\\" to prefix network drives or the drive letter if mapped

egg_violet <path>

Fully qualified path to source file(s).

Fully qualified target path.

egg_violet <filename>

Name of source file(s).

Name of target file.

egg_violet [...]

Parameters enclosed with brackets are optional.

egg_violet {...|...}

Choose 1 of the elements enclosed by braces. Elements are seperated by pipes / vertical bars ( | ).

Don't confuse the forward slash character ( / ) with the backslash character ( \ ). Use the \ character for paths. It is next to your backspace key on a standard keyboard.

ALZip does not automatically overwrite archive files if ones with the same name already exist. It will create a new easily identifiable name for the new file and keep the existing file.

<Creating archives from a command line (Compression)>

[script - no target specified]

alzip -a <drive>:\<path>[\<filename>][,<drive>:\<path>[\<filename>]...]

Ex) alzip -a "C:\My Stuff\Cool Stuff\Ice.mp3",C:\My Stuff\Cooler Stuff\Liquid Nitrogen.mp3"

- An ALZ archive is created.

- The destination archive name is automatically created in the current time-base format (year/month/day/hour/minute) (yyyymmddhhnn).

Ex) 200712312359.alz

[script - target is specified]

alzip -a <drive>:\<path>[\<filename>][,<drive>:\<path>[\<filename>]...] [<drive>:\<path>[\<filename{.zip|.alz}>]]

Ex) alzip -a "C:\My Stuff\Cool Stuff\Ice.mp3",C:\My Stuff\Cooler Stuff\Liquid Nitrogen.mp3" "C:\My Stuff\Cool Stuff\Cool Music.zip"

- Creates an ALZ or ZIP file archive as specified in the command line.

- The new ZIP file or ALZ archive is created in the user defined path.

[ Command line archive creation examples ]

(Without user defined destination path)

Command line with arguments

Result of command line

alzip -a c:\test.txt

C:\200412312359.alz

alzip -a c:\test.txt,d:\test2.txt,e:\test3.txt

C:\200412312359.alz

alzip -a c:\Mydirectory

C:\Mydirectory\200412312359.alz

(With user defined destination path)

Command line with arguments

Result of command line

alzip -a c:\test.txt c:\test.zip

c:\test.zip

alzip -a c:\test.txt,c:\test2.txt c:\test.alz

c:\test.alz

alzip -a c:\Mydirectory\ c:\DirectoryAdd.alz

c:\DirectoryAdd.alz

 

<Extract compressed archives from a command line (Extraction)>

All supported compression and archive formats are supported from the command line. If the destination path does not have enough disk space, extraction will fail.

[script - no target specified]

alzip -x <drive>:\<path>\<filename>[,<drive>:\<path>\<filename>...]

Ex) alzip -x"C:\My Stuff\Cool Stuff\Ice.zip",C:\My Stuff\Cooler Stuff\Liquid Nitrogen.rar"

- ALZip creates a new directory if one with the same name as the source archive does not exist, and extracts the archive contents to the folder.

[script - target is specified]

alzip -x <drive>:\<path>\<filename>[,<drive>:\<path>\<filename>...] [<drive>:\<path>\]

- Archives are extracted to the user defined directory. If the directory does not exist, ALZip will automatically create the directory for you.

Ex) alzip -x"C:\My Stuff\Cool Stuff\Ice.zip",C:\My Stuff\Cooler Stuff\Liquid Nitrogen.rar" "New Cool Folder"

[ Command line compressed archive extraction examples ]

(Without user defined destination path)

Command line with arguments

Result of command line

alzip -x c:\test.zip

c:\test\<contents>

alzip -x c:\test.alz,d:\test2.zip,e:\test3.alz

Extracts to 3 directories:

c:\test\<contents>, C:\test2\<contents>, c:\test3\<contents>

alzip -x c:\Mydirectory

c:\Mydirectory\<contents>

(With user defined destination path)

Command line with arguments

Result of command line

alzip -x c:\test.alz c:\MyFiles

c:\MyFiles\test\<contents>

alzip -x c:\test.alz,d:\test2.zip c:\MyFiles

Extracts to:

c:\MyFiles\test\<contents>

c:\MyFiles\test2\<contents>

alzip -x c:\Mydirectory c:\MyFiles

1) Extracts all compressed archives in 'MyDirectory' into the 'MyFiles' directory.

2) Creates new directory for each compressed archive in 'MyDirectory'

c:\MyFiles\<compressed file name from 'MyDirectory'>\<contents>

 

 

<Command Switches>

Command switches let you add or change functionality in a command issued from the command prompt. You can use several command switches together by typing them successively, e.g. "-b -off".

Some switches work with both the -a (add) and -x (extract) commands, while others work with either -a or -x, but not both.

Switches common to -a and -x

Switch

Description

-b

Background: Run the task as a background process, giving CPU priority to other programs

-off

Off: Logout of the current Windows user account when finished

 

Switches for -a (add)

Switch

Description

-sfx

Self-Extractor: Create a self-extracting EXE file.

Usage:

alzip -a -sfx myfile.txt mysfx.exe

-t

Test: Test archive after creating

Usage:

alzip -a -t myfile.txt mytest.zip

-d

Delete: Delete the original files to the Windows Recycle Bin after compressing

Usage:

alzip -a -d myfile.txt myarchive.alz

-si[index]

Select Icon: Choose one of the 4 available icons for the self-extracting EXE. This must be used with the -sfx switch. Use "si#" where "#" is a number between 1 and 4.

Usage:

alzip -a -sfx -si1 myfile.txt mysfx.exe

-p[password]

Password: Password protect an archive with this switch. Passwords that contain a space must be quoted. e.g. -p"my password"

Usage:

alzip -a -pthisisapassword myfile.txt mysecret.zip

alzip -a -p"this is a password with spaces" myfile.txt mysecret.zip

-af

Full Path: Include the full path to all added files.

Usage:

alzip -a -af *.* myarchive.zip

-v[size]

Volume Size: Set the size of the volumes in a spanned archive. Use "kb" or "mb" or "gb" for kilobytes, megabytes, or gigabytes. (They are case insensitive.) Use just a number to specify bytes exactly.

Usage:

alzip -a -v650mb myfile.txt myspanned.alz

alzip -a -v1457664 myfile.txt myfloppy.alz

alzip -a -v4.2gb myfile.txt mydvd.alz

-m[rate]

Compression Level: Set compression level from 0 to 4.

0 = maximum compression

1 = normal

2 = fast

3 = fastest

4 = no compression

Usage:

alzip -a -m0 myfile.txt mymaximumcompressed.zip

alzip - a -m4 myfile.txt myfastzippedarchive.zip

-an[list]

Exclude List: When compressing files, exclude all the files in the list. The list is comma separated. This may be used with wild cards, e.g. -an*.jpg,*.doc, etc. To exclude files from subdirectories, the directory name must be used. e.g. To exclude all JPG files in a subdirectory called "images" use -an\images\*.jpg

Usage:

To archive everything except MP3 files in the same directory:

alzip -a -an*.mp3 *.* myfiles.zip

To archive everything except MP3 files in the "music" subdirectory:

alzip -a -an\music\*.mp3 *.* myfiles.zip

To archive everything except JPG files and MP3 files in the "music" subdirectory:

alzip -a -an*.jpg,\music\*.mp3 *.* myfiles.zip

-xr

Exclude Recursion: Compress only files in current directory and exclude all files in subdirectories in compressed archive. For example, you need to compress all the files in the root directory, but don't want any subdirectories.

Usage:

alzip -x -xr *.* myarchive.zip

 

Switches for -x (extract)

Switch

Description

-xf

Exclude Folders: Exclude subdirectory names and extract all files in archive to 1 directory.

-xn[list]

Extract List: Extract only the files supplied in the comma separated list. No other files from the archive are extracted.

Usage:

alzip -x -xnmyfile1.txt,myfile2.txt myarchive.zip

Points to Remember: When using the command line, spaces are important. Do not use any spaces in lists or paths unless you use quotes. For example:

BAD: alzip -a my file.txt my file.zip

GOOD: alzip -a "my file.txt" "my file.zip"

<Command line and path/file name length limitations>

Windows imposes path and file name length limitations. These must be followed. (less than 255 characters or less than 2,096 characters)

Both command.com on Windows 9x/Me and cmd.exe on Windows NT/2000/XP have maximum lengths for command lines. You must observe these limtations. (less than 126 characters, less than 2,096 characters, or less than 8,192 characters)

 

Related Topics

- [ Contents ] - [ Index ] -

 

 

 


Copyright 1999-2009 by ESTsoft Corp. All rights reserved.
Contact
ALTools