Dear Kaplan, Andrew H, I’m Henry.
I ran this script on my machine and it worked. You can try the following command in PowerShell.
$ParentFolder = "D:\Test"
Get-ChildItem -Path $ParentFolder -Directory | ForEach-Object {
$File = Get-ChildItem -Path $_.FullName -File
if ($File) {
Move-Item -Path $File.FullName -Destination $ParentFolder -Force
Remove-Item -Path $_.FullName -Force -Recurse
}
}
Before, the 3 files were stored across 3 different folders
After running the command:
You can replace your parent folder in script.
I hope you’ll give my recommendation a try and let me know how it goes and if this answer helps, feel free to hit “Accept Answer” so others can benefit too