ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Finished Programs

DONE: In sub-folders, delete all files except the largest

(1/3) > >>

Given a folder, XYZ.  Look in sub-folders.  If more than one file exists within any one sub-folder, delete all except the largest file present.

Issue has arisen from capturing streaming audio 'radio stations' around the Internet.

One folder has 22 different copies of Queen's Radio Ga Ga.  Another, 20 copies of Madona's Like A Prayer. 18 MJ's Billie Jean.  And on and on.

Need a way to pare out the littler ones, I suppose.  Not the very best solution, because there is often announcer voice at the beginning of the longer items -- that's actually why they are longer.  But, keeping the longest/biggest seems the best bet I can think of.

Question is, how does one do this?

Hundreds of sub-folders, by the way.  So need an auto way.


Nicholas Kormanik

How about a safer reverse way, automatic copy biggest file inside sub-folder to new location, if you afterwards wish, delete that source folder.

Wow!  Outstanding thinking, KodeZwerg.

Now, how to go about doing THAT?

Perhaps copy to XYZ_Biggest....

Try the attached file (with some testdata folders first!)


Works fine here...

Hi Nicholas,

highend01 already gave to solution. Still I have attached two batch files I use to "delete all but latest 6 zip files in all subdirectories", i.e. instead of size it checks date. Since they are batch files, you may modify them as per your requirement.




[0] Message Index

[#] Next page

Go to full version