Solved

batch file for multiple zipped files

Posted on 2011-03-25
7
558 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
  • 3
  • 3
7 Comments
 
LVL 33

Expert Comment

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

  gzip.exe  *.txt
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
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
Comment Utility
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
Wish Marketing would stop bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 
LVL 1

Author Comment

by:itkamisama
Comment Utility
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 51

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
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
Comment Utility
Genius!!! Thanks
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
Glad that was helpful, thanks.

~bp
0

Featured Post

How does your email signature look on mobiles?

Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now