• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 603
  • Last Modified:

batch file for multiple zipped files

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
itkamisama
Asked:
itkamisama
  • 3
  • 3
1 Solution
 
knightEknightCommented:
download gzip.exe off the net (easy to google & find).  By default it compresses each file individually.  Example:

  gzip.exe  *.txt
0
 
Bill PrewCommented:
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
 
itkamisamaAuthor Commented:
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
itkamisamaAuthor Commented:
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
 
Bill PrewCommented:
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
 
itkamisamaAuthor Commented:
Genius!!! Thanks
0
 
Bill PrewCommented:
Glad that was helpful, thanks.

~bp
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now