Question Locked

How do I zip all files in a directory of a given file type?

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Edited for clarity and after further research...

How do I zip all files in a directory, of a given file type, into their original file names + ".zip"?

...on a Windows XP machine with WinZip's wzzip.exe command line utility installed.

Basically, I think I need a script (.bat, .vbs, .wsh) that will zip all *.log files in a directory, and have them be named after each original file name (e.g. logfile01.log.zip, logfile02.log.zip). I can either manually delete the original files after zipping, or have the batch file do so after each successful zipping. The latter would just be a bonus.

...or...even better, if possible...

A batch file that goes through a directory and converts all the files into a zip file that is named after each original file, but with a .zip extension instead of the original extension. Example: file test.txt, list.txt and play.txt can be converted into test.zip, list.zip and play.zip.

Requirements:

Must be able to be executed at a command line to affect the files in the current working directory.
Must be able to be run as a Windows Scheduled Task.

I've looked through all of winzip.com's FAQs and support pages, but no dice. I've also googled this extensively, but only Unix solutions or third party utilities come up in the results.

4 replies

by bfilmfan

You would need to copy all of them to a holding folder and zip that up. I'd recommend a batch file.

by rob miners

there is a command line addon and it also supports LFN. As BFilmFan has said it can be run through a batch file or a script.

http://www.pkware.com/download-software

Keep us informed as to your progress if you require further assistance.

If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D

by rob miners

and PKZIP Command Line Add-on. You can try before you buy.

Keep us informed as to your progress if you require further assistance.

If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D

This discussion is closed to new replies.