I am completely new to bat files. I have a folder with several thousand audio files. I would like to "export" the name and length of each and save them in a single text file. It seems simple, but I've struggled for hours just trying to get started. Can someone please help?! Thank you!!!!
Asked
Active
Viewed 1,829 times
2
-
By 'length', do you mean file size in bytes, or audio duration? – jarmod Nov 06 '15 at 16:34
-
By length I mean audio duration. In my folder view, that's how the duration is labeled.... 'Length' – Olive Nov 06 '15 at 16:35
-
4There's no native batch command that can read audio file metadata. You'll need a third-party program that has a command line interface, like MediaInfo. – SomethingDark Nov 06 '15 at 16:35
-
I see. Thank you for your answers. – Olive Nov 06 '15 at 16:40
1 Answers
2
Here's a PowerShell script that you can use to print MP3 filenames and audio duration. Redirect the output to a file as needed.
$path = 'C:\Users\Public\Music\Sample Music\'
Get-ChildItem $path -Filter *.mp3 -name | Foreach-Object {
$shell = New-Object -COMObject Shell.Application
$shellfolder = $shell.Namespace($path)
$shellfile = $shellfolder.ParseName($_)
write-host $_ $shellfolder.GetDetailsOf($shellfile, 27);
}
And here's info on how to run PowerShell scripts.