Re: creating multiple zip arhives?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

William Stokes wrote:
> Hello,
>
> I have about 2500 jpeg pictures in a different subfolders (in a same tree).
> There are about 10 pics in each folder. I need to compress these pics to a
> zip files. All pics in one subfolder to one zip file. So this means that
> there should be about 250 zip files located in the same folder where the
> original pics were.
>
> Any idea how to script this? I tried powerarchiver commandline with no luck.
> I'm not experinced enough in scripting so help is Very Much apreciated.

Depending on the directory names, something along the lines of this should
do: (which is run in the tree root and is run straight from the command line)

for /R /D %I in (*) do zip "<target path>\%~nI.zip" "%~fI\*"

I created three test directories: 1, 2 and 3. Inside all were a few dummy
files. Inside 3 was a further directory, 3a, with a dummy file in it. The
above command produced 1.zip, 2.zip, 3.zip and 3a.zip, all in the <target
path> directory. One could also add the -m switch to delete source files,
but only after careful checking of the output.

If you could be a bit more specific about the directory structure and where
you'd like the zip files to end up, the command could be tweaked if it
doesn't provide what you need. I use the zip software from Info-ZIP:
http://www.info-zip.org/

If they're on an NT partition you could always enable file compression ;-)

HTH
- --
Adam Piggott, Proprietor, Proactive Services (Computing).
http://www.proactiveservices.co.uk/

Please replace dot invalid with dot uk to email me.
Apply personally for PGP public key.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFDDdwN7uRVdtPsXDkRAosEAJ9+oZlV6grFb0RzGKvHKh3shIv0FACghebl
mZPvim+j0Ctlvcb3uPDT8dA=
=j1R+
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: creating multiple zip arhives?
    ... contain subfolders and some of the subfolders contain subfolders. ... I need the zip's to and up in the same folder with the source files. ... (which is run in the tree root and is run straight from the command ... > Please replace dot invalid with dot uk to email me. ...
    (microsoft.public.scripting.wsh)
  • Re: creating multiple zip arhives?
    ... > subfolders and with many files in every subfolder, ... > file), inside the ZIP I must have the folder structure and the files, ... *BE CAREFUL WITH THIS COMMAND* ... Please replace dot invalid with dot uk to email me. ...
    (microsoft.public.scripting.wsh)
  • subprocess call acts differently than command line call?
    ... are unix-style line endings on every file in that tree that is a text ... Both the command line "file" and the python libmagic binding give the ... with CRLF line ...
    (comp.lang.python)
  • Re: Backup/Copy tree with alias file
    ... So what does this SEARCH command give us? ... sys$specific 'root ... above and then add the alias to give it something to look for. ... one shouldn't manually delete a system directory tree ...
    (comp.os.vms)
  • Re: Substitute characters command
    ... Anybody who use any word processor to edit a text file needs to be aware ... Thanks to this forum I've learned how to get a directory tree by ... using the command ... Then I got strange characters so I used ASCII instead ...
    (microsoft.public.windowsxp.basics)