pack

Copyright 1992 - 2005, Stuart Udall

overview
important bits
installation
configuration and startup
controls and methods
issues and limitations
planned improvements
revision history
download

version 1.82, August 16, 2005


 
  overview next section top of page

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.


 
  important bits next section top of page

  • 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:
  1. This program is hereinafter known as "the Software".
  2. The Software comes with no warranty and is used at your own risk.
  3. The Software is not (and will never be) complete and as such may behave strangely.
  4. The Software is the copyrighted property of the author.
  5. The Software may be distributed freely.
  6. The Software may NOT be incorporated into a commercial work without prior written permission from the author.
  7. 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.


 
  installation next section top of page
  1. run the self-extracting distribution archive
  2. copy PACK.BAT to a directory in the PATH
  3. 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).


 
  configuration and startup next section top of page

  1. 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.

    variablefunctionexample
    ddwhere to put packed archivesc:\new
    tdwhere to put temporary files. This directory should be large enough for the largest unpacked archive PACK will process.d:\temp
    udwhere to find the packers and unpackers, such as PKZIP and ARJc:\dos\utils\arc
    dosdwhere to find CHOICE and DELTREEc:\windows\command
    scandwhere to find VirusScan, the McAfee virus scannerc:\dos\utils\virus
    scancthe name of the VirusScan executablescanpm.exe
    winrarlocwhere to find WinRAR - leave this blank to disable WinRAR and long filename supportc:\progra~1\winrar
    kokill original archive on exit *yes
    kfkill expanded files on exit * Use kill as a second command line parameter to override this setting.no
    packloglog messages to disk, as well as output to screenc:\pack.log
    * these two settings are case-sensitive; use lower case

    To turn logging off, leave the packlog setting blank.


 
  controls and methods next section top of page

  • 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

numbermessagecomments
[a][destination.ZIP] packed OKThe operation was successful.
[b1]STAMP.EXE not functioning - logging disabledEnsure STAMP.EXE is in your PATH; see notes on installation.
[b2]logfile inaccessible - logging disabledEnsure the logfile is defined correctly in the %PACKLOG% variable. See the notes on configuration.
[c0]warning: [source] not scanned for virusesThis 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 inaccessibleThe file(s) may be open with another program - try closing any other running applications.
[e]virus in memoryReboot 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 corruptIf 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 errorOne 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 failureYou might want to try again, or step through the PACK process manually until the fault is found.
[k]source [source] in unrecognised formatTry a newer version of the extraction tool (eg. ARJ.EXE).
[l]out of memoryTry relocating some TSRs to upper memory.
[m]source [source] may be encryptedPACK 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 typeDon'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 OKPACK 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 foundCheck 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 processedPACK 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.


 
  issues and limitations next section top of page

  • 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


 
  planned improvements next section top of page

  • EXE configuration editor
  • improve batch converter


 
  revision history next section top of page

19920.01initial development; basic implementation
1993-19941.00added additional archive formats
19951.20added support for viruscan
19961.54solidified errorhandling
19971.61added "pack from scratch"
19981.71rewrote with configuration variables
May 19991.72bugfixes
June 12, 19991.73added HTML documentation
Dec 30, 19991.74added unpack support for RAR
Mar 15, 20001.75added SCANC; added logging; added /AUTO
Oct 17, 20001.76added unpack support for ACE; bugfixes; streamlined output; improved documentation; bundled STAMP.COM
Nov 14, 20001.77added attribute stripping
Jan 17, 20011.78added long filename support via WinRAR
Dec 9, 20011.79bundled PACKWRAP (happy birthday, you-know-who!)
Aug 27, 20021.80improved PACKWRAP
Jun 21, 20031.81fixed 'sharing violation' bug during attribute stripping
Aug 16, 20051.82replaced STAMP.COM with STAMP.EXE


 
  download top of page

pack.exe  library