Okay, here is my issue,
I have around 1000 .zip files, give or take.
Each zip file has 1 file inside of it.
I want to delete the contents of each zip file while keeping the original zip file.
Yes I know I can open each zip file and delete the contents while keeping the original zip file but empty, one at a time,
but that would take forever!!
Does anyone know of a program that will let be delete all the files inside all the zip files at once ?
I want to keep the zip files the way they are named but just delete what is inside of them all.
I tried to see if there was a way to do it in bulk within winzip but could not find a way.
Also checked winrar and 7zip, but don;t see an option for what I want to do.
Total Commander maybe ??
Yeah, I know, I always come up with some crazy Q's no one seems to be able to answer....
+ Reply to Thread
Results 1 to 11 of 11
Originally a member since 2001, LONG LIVE TARAN's!!!
On a Windows system I would use PKZIP in a batch file like
for %%h in (*.zip) do pkzip -d %%h *.*
But surely when you delete the contents of a zip file you effectively delete the archive file. Or to put it another way, you can not have an empty archive.
I just tried it.
you can not have an empty archive.
7-zip (free, open source) has the ability too:
One zip file:
7z d filename.zip *.*
for %%h in (*.zip) do 7z d %%h *.*
for %%h in (*.zip) do 7z d %%h thumbs.db
Ok. I only tried it manually within WinRar. Once the content was deleted, the .zip vanished from the folder.
Well I am sure the OP has a good reason for doing this but, unless, again, I am mistaken, an empty archive is going to use the minimum allocated disk space set by the file-system which could somewhat defeat the purpose.
Yes, after 7-zip deleted all the files the remaining ZIP archive was 22 bytes. But it occupied a 4 KB cluster on the drive it was on, of course.
Okay, thanks everyone!!
I have 7zip, always have, but it is not associated with zip files, I usually only use 7zip with 7zip files.
So exactly how do I run it with a command line ?
Do I need to run it in the same folder with the zip files ?
It has a section in the help file on running command lines and I am going to read it now, but a step by step for dummies would be great
So I have the command line/window open,
I have all the zip files in a folder in the root of C:
Last edited by Noahtuck; 29th Oct 2013 at 15:54.Originally a member since 2001, LONG LIVE TARAN's!!!
If I learnt my previous lesson from jagabo correctly, you create a batch file with the command line inside it. Put the batch file somewhere you can find it and darg 'n drop your folder containing the .zip files on to it.
Okay, I have done stuff like that before, where you drag a folder or files into it and it does what it needs to do.
But it has been so looong I don't have a clue.
Man, you would think they would just include something in the menu to highlight and delete all the contents of all zip files.
Last edited by Noahtuck; 29th Oct 2013 at 16:09.Originally a member since 2001, LONG LIVE TARAN's!!!
Okay, never mind.
I got it!!
I made the text file with the command line you guys posted and renamed it .bat
Deleted all the contents of the zip files so I still have all the zip files with their original names but they are now empty and take up 1.6mb instead of the 1gb they previously did.
Thanks again!!Originally a member since 2001, LONG LIVE TARAN's!!!