Get Video Duration with PowerShell (No FFmpeg Needed)
Read a video file's Length property through the built-in Shell.Application COM object.
01Command
$ $sh=New-Object -ComObject Shell.Application; $f=$sh.Namespace('C:\Videos'); $v=$f.ParseName('clip.mp4'); $f.GetDetailsOf($v,27)02What it does
Explorer shows Length, frame width/height and bit rate for every video, and all of it is available through the Windows Property System — no media tooling required. Column 27 is Length on most Windows 10/11 builds, but verify by scanning all columns on one file first. Combine with Get-ChildItem in a loop to get durations for an entire folder of clips.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- System.Media.DurationEvidence: Defines the media duration property in 100ns units that Windows Explorer reads for video/audio files — the value GetDetailsOf exposes as a human-readable length.
- FolderItem object (Shell)Evidence: Documents Folder.ParseName / Folder.GetDetailsOf, the COM surface used to read a specific metadata column for a file.
Last verified: 2026-09-17 · Category: Media
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.