Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: bulk delete certain types of files in rar/zip archive

08 Jul 2014   #21
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
WOW... that's a lot of zipped up stuff ha ha.

Ok... starting where we left off, you are now within G:\zip_rar_copy\
This is where the fun / potentially dangerous bit begins... hence the "copy" of data.
Make sure you have WinRar installed - WinRAR archiver, a powerful tool to process RAR and ZIP files
(Download link at the bottom of the page 'English 64-bit')


Type or copy/paste the following into the command prompt:

This is currently set to remove .txt files, change the .txt bit at the end of the line to the filetype you want to remove.
Code:
for %I in (*.rar) do "C:\Program Files\WinRAR\WinRAR.exe" d -ibck "%I" *.txt
Once it finishes lets do the same but for .zip files...
Notice the difference at the beginning, i have changed (*.rar) to (*.zip)

This is currently set to remove .txt files, change the .txt bit at the end of the line to the filetype you want to remove.
Code:
for %I in (*.zip) do "C:\Program Files\WinRAR\WinRAR.exe" d -ibck "%I" *.txt

Now, when you look in the rar/zip files you shouldn't see anything of the file types you have just removed

Let me know how it goes.

Regards,
Jamie

oh my god.

winrar is now crazily generating many many error box, stating that 'the files are in use by other applications.' No No application is actually using those files. then it gives a lot of wired
unknown files... winrar now also 'freezes' and is likely to get crashed very soon.


My System SpecsSystem Spec
.
08 Jul 2014   #22
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

it can't stop.........i am poorly waiting until all their error boxes show up. It may take another few min
My System SpecsSystem Spec
08 Jul 2014   #23
JDobbsy1987

Windows 8.1 Pro x64
 
 

My testing was on a few files and that worked ok but just done a test against 200+ .rar files and see what you mean.

It still worked though but i did need to run it twice as i think it stopped half way through the first time.

You get a lot of dialog boxes, just right click the winrar icon on the taskbar and close all windows
My System SpecsSystem Spec
.

08 Jul 2014   #24
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
My testing was on a few files and that worked ok but just done a test against 200+ .rar files and see what you mean.

It still worked though but i did need to run it twice as i think it stopped half way through the first time.

You get a lot of dialog boxes, just right click the winrar icon on the taskbar and close all windows
now all closed.

luckily i made copies. but, did it affect any other files in other directory??
My System SpecsSystem Spec
08 Jul 2014   #25
JDobbsy1987

Windows 8.1 Pro x64
 
 

I have just ran it against 2500 .rar files and it worked fine
If you go through some of the rar files you should find that the file type you specified no longer exists?

It would have only affected files within G:\zip_rar_copy\
My System SpecsSystem Spec
08 Jul 2014   #26
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

very terrible!!!!! orignially it had 421 files in the folders, after the crashes and errors, now only 416 files remain.

My question is still - would it affect files on other directory ????????? It's a copy directory only but I don't know if any unexpected things happen on other sides I don't know.
My System SpecsSystem Spec
08 Jul 2014   #27
JDobbsy1987

Windows 8.1 Pro x64
 
 

It wouldn't have effected any other files, only files in g:\zp_rar_copy\
It doesn't sound terrible? -- Having less files would be expected if the .rar had only .txt files in them

For example:
Test.rar has only got 5 .txt files in it....

After running the command, it removes the 5 .txt files so there are no files lift in the .rar therefore removes it.

Have you looked inside any of the .rar files to see if it has removed the file extensions you told it to (i.e. .txt files)?
My System SpecsSystem Spec
08 Jul 2014   #28
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
It wouldn't have effected any other files, only files in g:\zp_rar_copy\
It doesn't sound terrible? -- Having less files would be expected if the .rar had only .txt files in them

For example:
Test.rar has only got 5 .txt files in it....

After running the command, it removes the 5 .txt files so there are no files lift in the .rar therefore removes it.

Have you looked inside any of the .rar files to see if it has removed the file extensions you told it to (i.e. .txt files)?
honestly, most of the files still have txt files inside after the operation. I don't think your method work. Is there any other alternatives?
My System SpecsSystem Spec
08 Jul 2014   #29
JDobbsy1987

Windows 8.1 Pro x64
 
 

Sorry it didn't for you but the script does work?
See the video i just put together showing .txt before and then no .txt after...

https://www.youtube.com/watch?v=4YcBfhZHenA

Hope you manage to achieve your goal.

Regards,
Jamie
My System SpecsSystem Spec
08 Jul 2014   #30
kenny1999

Microsoft Windows 7 Home Premium 64-bit 7600 Multiprocessor Free
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
Sorry it didn't for you but the script does work?
See the video i just put together showing .txt before and then no .txt after...

https://www.youtube.com/watch?v=4YcBfhZHenA

Hope you manage to achieve your goal.

Regards,
Jamie

OK,. i'll then delete them by myself. but I just want to make sure one more thing. That is, are you sure that the script you provided only change the files under that directory (zip_rar_copy)

the odd things happened make me concerned.
My System SpecsSystem Spec
Reply

 bulk delete certain types of files in rar/zip archive




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
How to add to RAR archive 40k files without using windows search.
I have over 40 thousand files I need to archive spread throughout a drive in different folders. I cannot use windows search because the drive cannot be index and will take quite some time to fix and solve. Is there another method that can allow me to search a drive and add to winrar .rar archive?...
General Discussion
BULK creating of folders based on file names, and then moving files in
Hi Everyone, i have been looking for weeks for a way to do this and i have tried so many applications but i just cant seem to get it right, i was hoping that you guys my be able to help me out here with this one.. i have two folders, at the moment with identical file names in the ( they...
General Discussion
Bulk delete parts of filenames?
I have a lot of files (songs) which names are of the following type: xxxx - yyyy Where x represents the artist's name and y represents the song's name. Now, I need a way to bulk edit these files so that everything left of the hyphen is removed and later on the hyphen itself so that the...
General Discussion
BSOD copying bulk files from ext. HDD
Hi all, I have a 1TB external HDD attached to my laptop. Whenever I attempt to copy multiple files to another HDD I am confronted with a BSOD. Can anyone read the dumpfile and see what my issue is, please? Thanks, Ed
BSOD Help and Support
removing damaged archive files?
Running win 7. Just scanned my C drive w/ESET and the scan turned up several damaged archived files (see below). Should I: 1. Delete the damaged archived files shown trusting that there won't be any repercussions later? 2. Leave everything as is and forget about it? 3. Any reason not to...
General Discussion
Windows 7 saving bulk files
I have received a link which has 50 jpg files in it. I opened the link and all the pictures are there. I clicked on select all and all files are highlighted and i clicked on save as but only one file is saved. Could you tell me, how can i save all of the 50 pictures to my pictures in bulk at...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:55.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App