I have at least 40 archive files, 100 MB each, which also includes many .jpg files within.

How I can delete the .jpg files from these archives easily?

To be more exact, I am looking for a way to delete all these fields directly from the archived file, without the need to extract it (Extract of the archive is not an option because the archive was done in a way to that I can not repeat)

  • I'm not an expert at editing archives, but why can you not extract? Extracting, deleting, then archiving each file seems like the straight-forward way to do this. You could write a script for this. Also, it'd be helpful to know what kind of system you are on and what file format the archive files are in. – EMPraptor Apr 12 '11 at 7:40

On Windows, install 7zip, and run following command in the folder with the zip files:

for /r %x in (*.zip) do "C:\Program Files (x86)\7-Zip\7z.exe" d -r %x *.jpg
  • 7zip is also available for other operating systems, though the details of the for loop would vary. – CarlF Aug 17 '11 at 15:02

Just open the .zip archive in Windows Explorer (if you are on a PC), right-click on the jpg file you want to delete, and choose delete. Windows will remove it from the archive without recompressing or changing any of the other files. I don't know how this works on other operating systems, but most should have a similar feature built in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.