A common shape for a big, messy media library is one folder per video: Some.Long.Folder.Name.2019\Some.Long.Folder.Name.2019.mkv, repeated hundreds or thousands of times, often with a few extra files inside each folder. It makes browsing slow, because you have to open a folder to see each file, and media players and TVs that browse by folder show a wall of near-identical names.
This guide shows two free ways to pull every video up into a single folder, how to avoid name clashes and data loss, and how to tidy the result. It finishes with how SceneSort Pro handles the same library without you having to move anything first.
.srt files, move them with their videos (Method 2 does this).kind:video. Windows lists every video in every subfolder. Wait until the green progress bar finishes.This is fine for a few hundred files. For thousands, Explorer's search can be slow and the name-clash prompts get tedious, so use Method 2.
This script moves every video, plus any subtitle with the same base name, from the subfolders of $src into $dst. If a file with the same name already exists, it adds a number instead of overwriting. Run it first as shown, with -WhatIf, so it only prints what it would do:
$src = 'D:\Video\Collection'
$dst = 'D:\Video\All'
New-Item -ItemType Directory -Force $dst | Out-Null
$exts = '.mkv','.mp4','.avi','.mov','.m4v','.wmv'
Get-ChildItem $src -Recurse -File | Where-Object { $exts -contains $_.Extension.ToLower() } |
ForEach-Object {
$base = $_.BaseName; $n = 1
$target = Join-Path $dst $_.Name
while (Test-Path $target) { $target = Join-Path $dst ("$base ($n)" + $_.Extension); $n++ }
$newBase = [IO.Path]::GetFileNameWithoutExtension($target)
Move-Item $_.FullName $target -WhatIf
Get-ChildItem $_.DirectoryName -File -Filter "$base*.srt" | ForEach-Object {
Move-Item $_.FullName (Join-Path $dst ($newBase + $_.Name.Substring($base.Length))) -WhatIf }
}
Read the output. When it looks right, remove both -WhatIf switches and run it again. Afterwards, the subfolders will hold only leftovers, which you can review and remove; the junk-files guide above includes a command that lists empty folders.
The free edition of SceneSort Pro has every feature and works on your first 500 files, with no time limit. Pro: unlimited files, US$29 one-time.
Pulling files into one folder makes the names the only thing you see, so this is the moment to clean them. If they look like Some.Long.Name.2019.1080p.x264.mkv, our guides to removing tags like 1080p and x264 and bulk renaming on Windows have copy-paste patterns. Then sort the files into a few broad folders (by type, year or series) so the "one giant folder" doesn't become the next problem.
Flattening is often a workaround for one real problem: you can't see all your videos at once. SceneSort Pro, our Windows app for organising a big, messy media library, solves that without touching the folder structure:
\\NAS\Videos). Subfolders are scanned automatically.The free edition includes every feature for your first 500 files, so you can try it on part of the collection before deciding how to restructure the rest.
Not automatically. That's why the script uses -WhatIf first. For a record of what moved where, run Start-Transcript moves.txt first, replace -WhatIf with -Verbose on the real run, then run Stop-Transcript.
Deeply nested folders can exceed Windows' traditional 260-character path limit. Flattening usually fixes this, but if a move fails with a path error, shorten the top folder name (for example D:\V) and run it again.
Yes. Plex, Jellyfin and similar servers will see the moved files as new on the next scan, so play history may reset. Do big moves before you set up a media server, or check its documentation for how it handles moved files.
The free edition builds a single library from all your folders and drives, and cleans names, for up to 500 files.
Try it free on 500 filesFree from the Microsoft Store. Pro: unlimited files, US$29 one-time · other install options
Optional: get 20% off the full version
We never sell your email. See our privacy policy.