Here's an example in powershell:
$src = "C:\Source"
$dst = "C:\Destination"
# get all the files including in subfolders, without including directory names
$files = Get-ChildItem $src -Recurse -File
# group files by name, withoutand extension
foreachonly ($groupthe inones (with matches
$grouped = $files | Group-Object -Property BaseName) | Where Count -GE 2
foreach ($group in $grouped){
# copy each group of files to a single folder
$group.Group.Fullname | Copy-Item -Destination (Join-Path $dst $group.Name)
}
ThisFor example, the files in this source folder:
C:\Source\Pictures\RAW\
FileOne.ARW
FileTwo.ARW
FileThree.ARW
C:\Source\Pictures\Compressed\
FileOne.JPG
FileTwo.JPG
will end upget copied to the destination like:
C:\Destination\FileOne\
FileOne.jpgARW
FileOne.txtJPG
C:\Destination\FileTwo\
FileTwo.jpgARW
FileTwo.pdfJPG