Solved

batch file for multiple zipped files

Posted on 2011-03-25
7
598 Views
Last Modified: 2012-05-11
I have just looked at this post

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_26673600.html?sfQueryTermInfo=1+10+30+archiv+compress+file+multipl

After trying out the script given on the post, I found it took all my 56 files and put it into 1 zip files instead of 56 individual zip files.

The 56 files files I need to turn into individual zip files is only 1 folder of many.
Anyone have any ideas?
thanks
0
Comment
Question by:itkamisama
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 35219317
download gzip.exe off the net (easy to google & find).  By default it compresses each file individually.  Example:

  gzip.exe  *.txt
0
 
LVL 55

Expert Comment

by:Bill Prew
ID: 35219929
Can you elaborate a little more?  

It sounds like you have many folders with many files in each, and you want each file to be in a separate ZIP file?  

Where do you want the resulting ZIP file to be located?  

And what ZIP tool do you want to use, 7zip, or something else?  

Will you process just one folder at a time, or are they all subfolders of some common parent, and you want to process the whole tree with one execution of a script?

~bp
0
 
LVL 1

Author Comment

by:itkamisama
ID: 35220189
I will try to download the file and try it.

To be more specific, I have a bunch of graphic files,which each needs to be zipped individually for upload to an online store. The name  convention is as easy as file01, file02...

As far as saving the files,any place on the PC is fine.
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 1

Author Comment

by:itkamisama
ID: 35235525
I downloaded gzip and was trying to find some documentation that would help me with my situation. Unfortunately I could not find any.
Naturally my next question is: "How do I use this?"
0
 
LVL 55

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 35236217
If you want to do it with 7-Zip this script should work.  Just adjust the path to the 7-Zip executable at the top, as well as the paths to the input and output folder names.  Save as a BAT file and run from a command prompt.

@echo off

REM Adjust path to 7Zip program as needed below
set "z=c:\program files\7-zip\7z.exe"

REM Set source and destination folder names
set FromDir=x:\EE\EE26912795\source
set DestDir=x:\EE\EE26912795\dest

REM Zip each file to its own zip file
for %%A in ("%FromDir%\*.*") do (
  "%z%" a -tzip "%DestDir%\%%~nA.zip" "%%~A"
)

Open in new window

~bp
0
 
LVL 1

Author Closing Comment

by:itkamisama
ID: 35236403
Genius!!! Thanks
0
 
LVL 55

Expert Comment

by:Bill Prew
ID: 35237147
Glad that was helpful, thanks.

~bp
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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