zip a list of files whose file names are in a text file

Posted on 2007-10-09
Last Modified: 2012-05-05
How to zip a list of files whose file names are contained in a file.

For example, I have a file contains 10 file names with full path of the file name.  I like to zip the 10 files into one zip file.  How can I do it?
Question by:fungfat
    LVL 16

    Accepted Solution

    You would need a licensed version of WinZip and would then have to download the WinZip Command Line Extensions.  You could then do a FOR loop to read in the contents of the file and use that to add the files in the list to your .zip file.

    for /f %%a in (filelist.txt) do (
      winzip command

    Here is a list of command line parameters.

    Author Comment

    Thanks btpringle.  Very thorough answer.  I have only the "evaluated" version, and no "command line" extension, so I cannot do the zipping with filelist yet.  But I believe I have it in the office.

    I check the site you gave me and find all the parameters for the command line to zip with a file that contains the list of file names.  It is like the following:

         winzip -min -a -r filenames.txt
                  -min is to run in minimized mode
                  -a is to add files to the zip file
                  -r is for recursive, meaning include all subfolders
         is the result file
                  filelist.txt contains all the file names to be zipped
    LVL 69

    Expert Comment

    the full version of winrar will do this, put them in a folder give it a name, ( TEM ) for an example purpose only,
     then  simply highlight the entire 10 and r/click them choose Add toTEMrar
    It will either produce one RAR or if the files exceed a ceratin size it will spit them out into separate rar numbered 1 to the end.
    Large files/games movies anything even  over 1 gig in size are compressed like this.
    From Wikipedia, the free encyclopedia

    Author Comment

    One mistake.  There must be a '@' in front of the filelist.txt to indicate to winzip that the file contains a list of files.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
    Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now