Solved

batch file for multiple zipped files

Posted on 2011-03-25
7
592 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 54

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 54

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 54

Expert Comment

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

~bp
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

Suggested Solutions

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
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.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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