2

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!!!!

Olive
  • 23
  • 3

1 Answers1

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.

Community
  • 1
  • 1
jarmod
  • 71,565
  • 16
  • 115
  • 122