Automatically sorts your photos, videos, and audio files into date-based subfolders (e.g. `20240315`) using each file’s “Media Created” metadata — the same date shown in Windows Explorer’s Details pane. Ideal for tidying up memory cards, camera dumps, or messy media folders.
Features
- Reads the Media Created metadata date from files (falls back to Last Modified if unavailable)
- Supports a wide range of formats: video (MP4, MOV, MKV, etc.), photos (JPG, PNG, RAW formats from Canon, Nikon, Sony, Fujifilm, and more), and audio (MP3, FLAC, WAV, etc.)
- Creates date-stamped subfolders in `YYYYMMDD` format
- Copies files by default — use `-Move` to move them instead
- `-WhatIf` flag lets you preview what would happen without making changes
- `-Recurse` flag to include files in subfolders
- Handles duplicate filenames automatically
- Operates on the current working directory — store the script anywhere and call it from inside the folder you want to organise
Usage
Navigate to your media folder, then run the script
cd "D:\Footage\2024"
organise-media.ps1
Move files instead of copying
organise-media.ps1 -Move
Preview changes without doing anything
organise-media.ps1 -Move -WhatIf
Include files in subfolders
organise-media.ps1 -Recurse -Move
Requirements
- Windows with PowerShell 5.1 or later (included with Windows 10/11)
- No additional software needed — uses built-in Windows Shell COM objects to read metadata
Running PowerShell Scripts
If you haven’t run PowerShell scripts before, you may need to allow it once. Open PowerShell as Administrator and run:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Then navigate to the folder containing the script and run it.
Adding the Script to Your PATH (Optional)
For convenience, you can add the folder containing the script to your system PATH so you can run it from any directory:
- Press Win + S and search for “Environment Variables”
- Click “Edit the system environment variables”
- Click Environment Variables at the bottom
- Under User variables, select Path and click Edit
- Click New and paste the full path to the folder where you saved the script (e.g. `C:\Scripts`)
- Click OK on all dialogs
- Restart any open terminal windows
You can now run `organise-media.ps1` from anywhere without navigating to the script’s folder first.
Free download — if you find it useful, consider supporting development