MicrostockGroup

Microstock Photography Forum - General => Off Topic => Topic started by: Microbius on August 30, 2011, 05:27

Title: Script or similar to zip files based on file names
Post by: Microbius on August 30, 2011, 05:27
I am looking for a way of automating the following:
I have folders of illustrations each one as a jpeg file and also as an eps file. The two files for each illustration share the same name apart from the extension.
Is there an automated way of getting Windows to zip the pairs together in one zip file each.
It's proving to be very time consuming going through the folders and doing this by hand.
Title: Re: Script or similar to zip files based on file names
Post by: microstockphoto.co.uk on August 30, 2011, 06:35
I had the same problem... not a completely automated solution but the best I found:

from the dos command line:

c:\>dir /s /b *.eps >c:\filename.bat

(/s lists subdirectories; /b outputs file name only without headers; >filename.bat sends output to file)

open c:\filename.bat with a text editor and replace text in each line
in order to replace <filename>.eps with pkzip <filename>.* <filename>.zip
you may have to do this part manually through copy and past but it's still faster

put pkzip.exe in the same folder (you need an old command line version of PkZip)

launch filename.bat

seems a bit crooked but saves time in the end
Title: Re: Script or similar to zip files based on file names
Post by: Microbius on August 30, 2011, 09:20
Thanks Claudio but I fear the dos prompt! Your post is going to get a heart anyhow for taking the time to post.
Title: Re: Script or similar to zip files based on file names
Post by: microstockphoto.co.uk on August 30, 2011, 09:30
yes, the dos prompt can be scary but it's so cool!