Question

Im trying to move a picture in every zip folder in current directory. I searched online for some guidance on how to do it using batch (.bat) and the only solution I figured out is to make a macro of it but it takes too long for it to complete.

Edit: I have 50 zip folders which I want to add a picture inside each one in a faster way other than draging the picture each time inside each of the 50 zip folders.

I would appreciate any other ideas and help you could offer.

Was it helpful?

Solution

Test this on some sample zip files in a test folder. It assumes 7-zip is in the folder shown.

It's not so much faster as it is easier, without manually manipulating the files.
The actual zipping speed will be pretty much the same.

@echo off
for /f "delims=" %%a in ('dir *.zip /b /a-d') do (
   "C:\Program Files\7-Zip\7z.exe" a "%%a" "my-picture.jpg"
)
pause

OTHER TIPS

Adds (or updates) README.txt in the zipfiles foo.zip and bar.zip from README.txt in the current directory:

$ for f in foo.zip bar.zip ; do zip -u $f README.txt ; done

You can package files into a zip file using the Winzip utility. It must be installed on your computer. Follow these steps:

  1. Select the files you need and click on any of the selected ones.
  2. Select Add to Zip
  3. In the Add window, in the Add to Archive field, specify the path and name of the archive to be created.
  4. The ZIP file is saved at the path you specified.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top