Win 7 64 bit.
I am trying to obtain the length of mp3 and mov files using extended file properties. I created a nasty, but working way using VBS but thought I’d give PowerShell a try and found an example to modify.
It gives me the correct answer SOMETIMES as I test with various files, but sometimes NOT. It is driving me crazy. For a correct answer, I’m using the Length value I can display in Windows Explorer.
I also realize I must divide length by some value to convert to seconds, but I have to keep changing this value for various files to get the correct answer. 16000 works for one mp3 file, but not another in the same folder. What should be 02:22 comes back as 02:58 for one and 01:00 and 01:01 (which is fine) for another. What the heck am I doing wrong?
Finally, I have four versions of PS in my start menu…. PS (x86), PS ISE, PS, and PS (x86) ISE. What’s the difference?
“C:Windowssyswow64Windowspowershellv1.0powershell.exe” -noexit dir “D:AudioSongsOtherSongsTheme 1.mp3″ | Select-object @{Expression={ ‘{0:#,00.00}’ -f ($_.length/16000)};Label=”Playing time”}
Thanks for any help in any of this.