[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Compress directories using pkzip

Posted on 2004-04-02
6
Medium Priority
?
4,185 Views
Last Modified: 2008-02-26
I have a batch file that copies a directory which contains sub-directories and sub-sub directories, etc.  You get the point.  That directory is roughly 100 megs and I want to compress it using PKZIP.  I know you can compress a directory by doing:
PKZIP -r name_file.zip     where -r is recurse subdirectories

My question is when I do that i get the error PKZIP (E19) Insufficient memory.  Any help?

Thanks for the help in advance.
0
Comment
Question by:chigs20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10744695
It appears to be a limitation of the software. This is what their website says about this problem http://www.pkzip.com/support/faqs/pkzip_dos/index.html#9:

I am receiving insufficient memory when using PKZIP for DOS. Why?

If you are receiving an insufficient memory message, most likely it is because you are trying to compress more files than you have available conventional memory. PKZIP for DOS requires approximately 200K of conventional memory to run, plus 100 bytes per file you attempt to add. Your options are to free up more conventional memory if possible or to compress less files.

Using the above calculations, the DOS version can compress approximately 5000 files.

Note: PKZIP for Windows can compress up to 16,000 files.
0
 
LVL 30

Accepted Solution

by:
SteveGTR earned 375 total points
ID: 10746671
You could try this. It creates a backup.zip file and zip's up 2000 files at a time. You must run the batch from the directory where you want to zip up the files:

@echo off
setlocal enabledelayedexpansion

set filename=backup.zip
set maxfiles=2000
set filecnt=0

if exist __files.txt del __files.txt > NUL

for /R .\ %%a in (*.*) do (
  if /I "%%~nxa" NEQ "%filename%" (
    if /I "%%~nxa" NEQ "__files.txt" (
      if /I !filecnt! GTR %maxfiles% (
        set filecnt=0
        pkzip %filename% @__files.txt
        pause
      )  
   
      echo %%a >> __files.txt
      set /A filecnt+=1
    )
  )
)

if exist __files.txt (
  pkzip %filename% @__files.txt
  del __files.txt > NUL
)

echo.
echo %filename% created

Good Luck,
Steve
0
 
LVL 2

Expert Comment

by:rogerperkins
ID: 10746738
Look for cabarc.exe.
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 30

Expert Comment

by:SteveGTR
ID: 10749282
Couple of adjustments to batch file:

@echo off
setlocal enabledelayedexpansion

set filename=backup.zip
set maxfiles=2000
set filecnt=0

if exist __files.txt del __files.txt > NUL

for /R .\ %%a in (*.*) do (
  if /I "%%~nxa" NEQ "%filename%" (
    if /I "%%~nxa" NEQ "__files.txt" (
      if /I !filecnt! GTR %maxfiles% (
        pkzip %filename% @__files.txt
        set filecnt=0
        del __files.txt > NUL
      )  
   
      echo %%a >> __files.txt
      set /A filecnt+=1
    )
  )
)

if exist __files.txt (
  pkzip %filename% @__files.txt
  del __files.txt > NUL
)

echo.
echo %filename% created
0
 
LVL 11

Expert Comment

by:lbertacco
ID: 10757055
Are you using an old pkzip like v2.50? This has lots of problems. Try a more recent one or, better, you can use "WinZIp command line tools", from www.winzip.com (free but requires winzip) or infozip "zip" utility from http://www.info-zip.org/ (free)
0
 
LVL 8

Expert Comment

by:K_2K
ID: 10765668
Not enough free time Steve?  
*<;-))

Nice script, I would recommend a much lower maxfiles number, or a check of file size for the cutoff.

Basicly, the below is trying to say PKZIP has to have the file in memory AND have space to process the names left over.

Also, for this type of thing I would register it to get the latest version, whatever that is.

(\o/)  Enjoy,
2K


From PKWARE manual for Version 2.5 :

@[filename]  Specify LIST file
.
.
.

The size of a list file that may be processed is limited. The total
size of the list file depends upon two factors.

The first is path storage. If paths are specified in the list file
and are NOT stored with the -P option, the list file size is limited
to approximately 7000 bytes.

If paths are specified and are stored, the list file size is limited
to 9700 bytes.

If a list file has drive letters specified as part of the file names
within the file, the maximum list file size is reduced. When paths
are not stored the maximum size is 5100 bytes, when they are stored
6600 bytes.

Note that this table corresponds to the total size of all list files
being used in a single command.

+-------------------------------------------------------------------+
| List File Size Limits      |  No Path Storage | Path Storage (-P) |
|----------------------------+------------------+-------------------|
| Drive Letters in List File |    5100 bytes*   |       6600        |
|----------------------------+------------------+-------------------|
| No Drive Letter            |       7000       |       9700        |
+-------------------------------------------------------------------+
* These numbers are approximate and may vary depending on your
  configuration.

If the list file is too big, you will receive an "Insufficient
Memory" error. If you have a list file which is too big, you may
split it into two or more smaller list files and perform multiple
PKZIP operations.


If you use PKZIP on a regular basis you are strongly encouraged to register
it. With a full registration you will receive a comprehensive printed manual,
the latest version of PKZIP, PKUNZIP & PKSFX software, and discounts on
future upgrades of PKZIP for DOS and other platforms. See the documentation
for ordering and commercial & distribution licensing information.
PKWARE, Inc.            Internet:   www.pkware.com      Phone: 414-354-8699
9025 N. Deerwood Drive  Sales:      sales@pkware.com    Fax:   414-354-8559
Brown Deer, WI 53223    Tech supp.: support@pkware.com  BBS:   414-354-8670
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question