Tech Support > Microsoft Windows > Help and Support > How to add to a zip archive from the commandline all files from a filelist in a textfile ?
How to add to a zip archive from the commandline all files from a filelist in a textfile ?
Posted by Tom Parson on September 30th, 2005


I have a textfile where hundereds of files (with path) are listed.

Now I want to add all these files to a (win)zip archive.
How do I do this from the command line ?

Using a DOS batch procedure with a command like:

for /F "tokens=*" %%* in (myfiles.lst) do zip "myarchive.zip" "%%*"

is not useful since the zip program needs to close and re-open the zip archive
for each file separately which is rather time consuming (20 times longer
than adding all files in one step)!

Is there a syntax which allows me to add all files in one step?

Tom

Posted by Ron Rector on September 30th, 2005


This software (PKZIP) may be a little old school but should get the job done
just the same. Here a link to check it out.

http://www.pkware.com/home_and_small_office/downloads/

"Tom Parson" wrote:

> I have a textfile where hundereds of files (with path) are listed.
>
> Now I want to add all these files to a (win)zip archive.
> How do I do this from the command line ?
>
> Using a DOS batch procedure with a command like:
>
> for /F "tokens=*" %%* in (myfiles.lst) do zip "myarchive.zip" "%%*"
>
> is not useful since the zip program needs to close and re-open the zip archive
> for each file separately which is rather time consuming (20 times longer
> than adding all files in one step)!
>
> Is there a syntax which allows me to add all files in one step?
>
> Tom
>
>