Isso pode ser feito facilmente com o powershell.
# Set the source and destination paths (No trailing slash)
$source = "C:\subtree"
$dest = "C:\consolidated"
# Get a list of all files recursively
$files = Get-ChildItem -Path $source -Recurse
# Process each file
$files | ForEach-Object {
# Basename is filename w/o ext
$baseName = $_.BaseName
$ext = $_.Extension
# Build initial new file path
$newName = "$dest\$($_.Name)"
# Check for duplicate file
If (Test-Path $newName) {
$i = 0
# While the file exists, increment the number that will be appended
While (Test-Path $newName) {
$i++
$newName = "$dest\$baseName($i)$ext"
}
}
# If the file is not a duplicate, write the (placeholder) file.
Else {
New-Item -ItemType File -Path $newName -Force
}
# Copy the file contents to the destination
Copy-Item $_.FullName -Destination $newName -Force
}
Como você é novo no PowerShell, sugiro usar o Powershell ISE incluído. Ele permitirá que você cole este script e trabalhe mais facilmente.