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

DonationCoder.com Software > Finished Programs

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

<< < (2/3) > >>

KodeZwerg:
I have not figured out given solutions, if still needed, i could create a CopyBiggestToNewLocation type of app.

4wd:
Quick and dirty:


--- Code: PowerShell ---Get-ChildItem <SRCE> -Recurse -Directory | % { Get-ChildItem $_.FullName -File | Sort-Object Length -Descending | Select-Object -First 1 | Copy-Item -Destination <DEST> }
Change <SRCE> to the source directory, (eg. Z:\test -- the parent of all the sub-directories), change <DEST> to the destination directory, (eg. K:\output), and it should copy the largest file in every sub-directory of the source to the destination, (directory tree is NOT preserved).

If there's an existing file of the same name it'll just skip copying that file, (ie. nothing gets overwritten).

eg.

--- Code: PowerShell ---Get-ChildItem Z:\test -Recurse -Directory | % { Get-ChildItem $_.FullName -File | Sort-Object Length -Descending | Select-Object -First 1 | Copy-Item -Destination K:\output }

rjbull:
If I understand you correctly...  here's a GUI method.

Download Robert Vasicek's Cathy media cataloguing tool.  It's tiny, fast, portable and postcard-ware.  Set up the directories you want to check, make catalogues of them - no need for separate ones if they're in the same part of the tree, just include subdirectories, but mine were well separated.  Cathy can also make catalogues of CDs, DVDs, etc., i.e. offline holdings, so you can check them at the same time:

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

You can make one or more catalogues, highlight all the ones you want to search.  Tell it what sort of files you want to search for, in my case, *.JPG.  Then tell it you want to search not Duplicates, but Same names:

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

Then hit the Search button.  You can sort the resulting list by clicking the Length column:

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

You get a Right-Click menu, though it may not do enough for you:

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

There are plenty of other duplicate finder out there, e.g. the excellent Double Killer (free and payware versions): Nir Sofer's SearchMyFiles has a Duplicates mode: so does XYplorer...

nkormanik:
highend01 seems to have accomplished the task perfectly.  What magic!

His little gem is a significant addition to the utilities in our tool bags.

Thanks very much, highend01!  And to all the rest of you.

Skwire, another success....

highend01:
I had the time to improve my version (a tiny bit)...

It now creates a log file (in %TEMP%) with the files that have been deleted and
automatically opens it with the associated application afterwards

It should be about 10-20 times faster than the old version (on fast hardware like SSDs)
because of better designed structures and ways to find the largest file...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version