Is there a way to use Bulk Rename Utility to delete duplicat

Post any general comments regarding Bulk Rename Utility here. Open to all registered users.

Is there a way to use Bulk Rename Utility to delete duplicat

Postby stevejock1 » Fri Feb 14, 2020 3:35 pm

Not sure if this is the right place to put this, but it's the best I could think of.

Situation: there are five folders called "FolderA" "FolderB" etc etc. Each folder has a folder nested directly "beneath" (not proper parlance, i know, I cant remember) that is also called "FolderA" etc. I want to run a program or script to remove all the duplicate folders. This situation usually is a product of unzipping compressed archives with WinRAR or 7-Zip. I have more than just the five, fyi, try over 500. People need to learn how to compress stuff better.
stevejock1
 

Re: Is there a way to use Bulk Rename Utility to delete duplicat

Postby bru » Fri Feb 14, 2020 9:31 pm

Hi, Im not aware of any apps out there that can delete based on such criteria.
If you want to download a small (80kb) commandline app called sed, its very easy to script.
dir/b/s/ad|sed -n -r "/.*\\(.{1,})\\\1$/s/(.*)/rd \/s \/q \x22\1\x22/p"

That would create the following commands for every such matching folder below where you ran it.
rd /s /q "C:\Users\Me\Desktop\aaa\aaa"
rd /s /q "C:\Users\Me\Desktop\abc\xxx\gg\gg"

It will not execute the commands, but it wouldnt take much more to have them auto-deleted.
I hesitate to post anything more.. As a commandline app, nothing goes to the recycle-bin.
If you wanted to keep even one of them, it could spell disaster.. Plenty of forums with sed.
Cheers.
bru
 
Posts: 62
Joined: Wed Jan 31, 2018 7:35 pm


Return to General Comments