PACK is a DOS batch file that automates archive management.
PACK features in brief:
- converts archives from ACE, ARC, ARJ, LHA, LZH, PAK, RAR, SDN, ZIP and ZOO to ZIP or RAR
- creates new archives from scratch
- supports subdirectories and nested subdirectories
- supports long filenames
- deletes headers and unwanted advertising from source archives
- maximises compression to minimise resource utilisation
- strips all attributes from all extracted files and scans them for viruses
- can log to disk; has "auto" mode
- configuration via variables
- solid error handling
Using the included PACKWRAP.EXE, it's possible to get PACK to do batch conversions (from ZIP only).
PACK started life on June 1, 1992. I'm sure the time for PACK has actually passed, but I still use it, so perhaps someone else could.
PACK converts existing archives, or creates a new archive from files in the current directory (and its subdirectories).
I'm still seeing archives come through in a variety of formats, some with headers and some without maximum compression.. and of course viruses are out there. PACK rectifies these problems - it unpacks incoming archives, strips headers, scans for viruses, and repacks, in ZIP or RAR format with maximum compression.
 
- requires MS-DOS 6.x or higher (CHOICE, DELTREE, FIND, ATTRIB)
- requires STAMP.EXE (included, licence-free)
- long filename support requires Windows 9x and WinRAR 2.7 or higher
- requires PKZIP/PKUNZIP 2.x or higher
- requires McAfee/Network Associates VirusScan 2.x or higher
- the following points are this program's terms and conditions of use:
- This program is hereinafter known as "the Software".
- The Software comes with no warranty and is used at your own risk.
- The Software is not (and will never be) complete and as such may behave strangely.
- The Software is the copyrighted property of the author.
- The Software may be distributed freely.
- The Software may NOT be incorporated into a commercial work without prior written permission from the author.
- The Software is "donateware" - you can choose your amount, and pay with Paypal! Donating will encourage me to create more tools. If you do decide to donate, thankyou in advance; the form is here.
There is a feedback form here.
 
- run the self-extracting distribution archive
- copy PACK.BAT to a directory in the PATH
- ensure you have CHOICE, DELTREE, FIND, ATTRIB, VirusScan, any relevant uncompressors, and PKZIP somewhere in the PATH
the PATH is defined in C:\AUTOEXEC.BAT and consists of a series of directories, each separated by a semicolon. To place a program in the PATH, copy it into a directory which is mentioned in the PATH statement.
CHOICE, DELTREE, FIND and ATTRIB are probably in the PATH already; PKZIP and PKUNZIP may not be.
- error 24: "out of environment space" messages: use the /e:nnnn parameter in the SHELL command in CONFIG.SYS to increase the size of your environment space. Edit CONFIG.SYS with a text editor and add the following line (or edit the line if it already exists):
SHELL=[[dos-drive:]dos-path]COMMAND.COM [[drive:]path][device] [/E:nnnn] [/P [/MSG]]
The parameter to change is /e: - increase the number, or enter at least 1024 if it is blank.
If you use the SHELL statement, make sure you also use the /P parameter. This tells DOS to run AUTOEXEC.BAT - leaving it off will cause DOS to boot without running AUTOEXEC.BAT. For example, my SHELL command is
Example: shell=C:\COMMAND.COM C:\ /e:1024 /p
For more detailed help on the SHELL command, see the MS-DOS help (type HELP CONFIG.SYS).
 
- edit PACK.BAT to make it reflect your local system. PACK uses several variables which require customisation prior to use. These variables are defined at the top of the PACK.BAT file. Use a text editor to change them - change other things if you feel comfortable doing so. The table below summarises the variables and their functions, and provides an example.
| variable | function | example |
|---|
| dd | where to put packed archives | c:\new
| | td | where to put temporary files. This directory should be large enough for the largest unpacked archive PACK will process. | d:\temp
| | ud | where to find the packers and unpackers, such as PKZIP and ARJ | c:\dos\utils\arc
| | dosd | where to find CHOICE and DELTREE | c:\windows\command
| | scand | where to find VirusScan, the McAfee virus scanner | c:\dos\utils\virus
| | scanc | the name of the VirusScan executable | scanpm.exe
| | winrarloc | where to find WinRAR - leave this blank to disable WinRAR and long filename support | c:\progra~1\winrar
| | ko | kill original archive on exit * | yes
| | kf | kill expanded files on exit * Use kill as a second command line parameter to override this setting. | no
| | packlog | log messages to disk, as well as output to screen | c:\pack.log
|
* these two settings are case-sensitive; use lower case
To turn logging off, leave the packlog setting blank.
 
- type PACK arcname from the command line
where arcname is either an existing archive to convert, or a name for a new archive.
Warning: do NOT supply an extension or a path on the PACK command line. Eg, "pack c:\test", "pack test.arj" and "pack c:\test.arj" are not supported and may produce unpredictable results!
If kill is used as a second parameter, uncompressed files will be deleted after they have been (re)compressed into the target format. kill does not work if you are packing from scratch.
- PACK will ask for confirmation before processing - use this opportunity to abort, if required.
After confirmation, no additional user input is needed.
if /AUTO is used as a second parameter, PACK does not ask for confirmation before operating. /AUTO enables "kill" - uncompressed files will be deleted automatically.
- typing PACK with no parameters will produce a brief help screen.
- to use PACK in batchmode, run PACKWRAP.EXE. Enter the name of each directory you wish to convert. PACKWRAP generates a batchfile in the current directory called CONVERT.BAT. If this file already exists, PACKWRAP can append to it, or replace it. PACKWRAP can start the conversion immediately, or you can add more directories, exit PACKWRAP and run CONVERT.BAT later. When you run CONVERT.BAT, all ZIPfiles in the nominated directories will be converted to RAR.
Error messages
| number | message | comments
|
|---|
| [a] | [destination.ZIP] packed OK | The operation was successful.
| | [b1] | STAMP.EXE not functioning - logging disabled | Ensure STAMP.EXE is in your PATH; see notes on installation.
| | [b2] | logfile inaccessible - logging disabled | Ensure the logfile is defined correctly in the %PACKLOG% variable. See the notes on configuration.
| | [c0] | warning: [source] not scanned for viruses | This is a warning message that is displayed when the user elects not to scan the files for viruses before (re)packing.
| | [c1] | possible virus in [source] | Extract the archive manually, and scan the files for viruses.
| | [d] | some or all of [source] is inaccessible | The file(s) may be open with another program - try closing any other running applications.
| | [e] | virus in memory | Reboot with a clean floppy and nuke the virus.
| | [f] | could not create [destination.ZIP] | The file may be open with another program. Close other applications and try again. If you're on a network, check that you're logged in, and have access privileges.
| | [g] | unable to open source [source] | The file may be open with another program. Close other applications and try again. If you're on a network, check that you're logged in, and have access privileges.
| | [h] | source [source] is corrupt | If this error persists, try running an archive repair program such as PKZIPFIX (or equivalent) over the source archive.
| | [i] | utility failure; undefined error or internal error | One of the programs used by PACK has failed. You might want to try again, or step through the PACK process manually until the fault is found.
| | [j] | internal PACK failure | You might want to try again, or step through the PACK process manually until the fault is found.
| | [k] | source [source] in unrecognised format | Try a newer version of the extraction tool (eg. ARJ.EXE).
| | [l] | out of memory | Try relocating some TSRs to upper memory.
| | [m] | source [source] may be encrypted | PACK does not support password-protected archives.
| | [n] | extract failed: disk full? | You've probably run out of disk space. Generally, at least twice the size of the source archive needs to be available in order for a PACK operation to succeed.
| | [o] | compress failed: disk full? | You've probably run out of disk space. Generally, at least twice the size of the source archive needs to be available in order for a PACK operation to succeed.
| | [p] | user break |
| | [q] | no files extracted from [source] | The file(s) may be open with another program - try closing other applications.
| | [r] | extension supplied/unable to determine archive type | Don't supply an extension on the command line. Type "PACK STUFF", not "PACK STUFF.ARJ".
| | [s] | backup file [source.OLD] exists (check PACK documentation) | The source file is a ZIPfile in the destination directory. This file would be overwritten when the new ZIPfile is created. PACK attempted to rename the source file to [source.OLD] but this file exists. Without the backup file, data might be lost. Rename the existing backup file and retry the operation.
| | [t] | unable to remove source [source] - [destination.ZIP] packed OK | PACK could not delete the original archive because it was read-only. This does not affect the target archive - PACK successfully processed the original archive, but couldn't remove it afterwards. Given that a PACKed copy of the original archive exists, the original archive can be safely deleted. Of course, you'll have to remove the read-only status first. Use ATTRIB from DOS, or edit the file's Properties using Windows Explorer. Note: if the original archive was a ZIPfile, PACK will have replaced it with the PACKed copy, which is NOT read-only. The original archive was renamed by PACK to *.OLD - if your archive was called READONLY.ZIP, it will now be called READONLY.OLD, and it will still be read-only. The processed copy of the file will be called READONLY.ZIP and it will NOT be read-only.
| | [u] | extractor for [archivetype] not found (check [utilitydirectory]) | Check the utility directory environment variable ud to see that it points at the directory in which the extraction tool (eg. PKUNZIP) for that archivetype is located. See the notes on configuration.
| | [v] | compressor not found (check [utilitydirectory]) | Check the utility directory environment variable ud to see that it points at the directory in which PKZIP is located. See the notes on configuration.
| | [w] | unable to remove temporary files (check [DOSdirectory]) | Check the DOS directory environment variable dosd to see that it points at the directory in which DELTREE is located. See the notes on configuration.
| | [x] | viruscanner [scannerdirectory\scannerexecutable] not found | Check that the SCAN directory environment variables scand and scanc point at the directory in which the viruscanner is located, and the name of the virusscanner executable, respectively. See the notes on configuration.
| | [y] | Out of environment space (check PACK documentation) | See the notes on installation.
| | [z] | no archive was created or processed | PACK did nothing.
|
Note: if your error message says ".SCRATCH" instead of .RAR or .ZIP, that's fine - it simply means PACK was about to create that archive from scratch - until the error occurred.
Note: if your error message says ".RAR" instead of .ZIP, that's fine - it simply means PACK has found your installed copy of WinRAR and was about to use it - until the error occurred.
 
- PACK does not work if an extension is supplied on the commandline
- PACK has not been tested with PKZIP 2.50 or above, or WinRAR 2.7 or below
- PACK cannot process filenames with multiple periods in them
 
- EXE configuration editor
- improve batch converter
 
| 1992 | 0.01 | initial development; basic implementation
| | 1993-1994 | 1.00 | added additional archive formats
| | 1995 | 1.20 | added support for viruscan
| | 1996 | 1.54 | solidified errorhandling
| | 1997 | 1.61 | added "pack from scratch"
| | 1998 | 1.71 | rewrote with configuration variables
| | May 1999 | 1.72 | bugfixes
| | June 12, 1999 | 1.73 | added HTML documentation
| | Dec 30, 1999 | 1.74 | added unpack support for RAR
| | Mar 15, 2000 | 1.75 | added SCANC; added logging; added /AUTO
| | Oct 17, 2000 | 1.76 | added unpack support for ACE; bugfixes; streamlined output; improved documentation; bundled STAMP.COM
| | Nov 14, 2000 | 1.77 | added attribute stripping
| | Jan 17, 2001 | 1.78 | added long filename support via WinRAR
| | Dec 9, 2001 | 1.79 | bundled PACKWRAP (happy birthday, you-know-who!)
| | Aug 27, 2002 | 1.80 | improved PACKWRAP
| | Jun 21, 2003 | 1.81 | fixed 'sharing violation' bug during attribute stripping
| | Aug 16, 2005 | 1.82 | replaced STAMP.COM with STAMP.EXE
|
 
pack.exe  library
|