I discovered that powershell came with the acer laptop (I am not a programmer, but I have used simple batch files in times past (btw the os is Win7 Home).
Someone posted what I pasted below, but the time-length (hh:mm:ss) does not display (maybe called the duration).
Can someone tell me how I can report the file data including the audio/visual time length?
It appears the sample below calls the file size (bytes) the length and the dir cmd calls (hh:mm:ss) the length.
Also, can this be converted to a batch file or some kind of powershell script to be run in powershell when desired?
Pasting the code into powershell works as-is with a lot of error messages.
Please advise.
Thanks, Tracey
$Directory = "D:\My Source Folder"
$Shell = New-Object -ComObject Shell.Application
Get-ChildItem -Path $Directory -Recurse -Force | ForEach {
$Folder = $Shell.Namespace($.DirectoryName)
$File = $Folder.ParseName($.Name)
$Duration = $Folder.GetDetailsOf($File, 27)
[PSCustomObject]@{
Name = $.Name
Size = "$([int]($.length / 1mb)) MB"
Duration = $Duration
}
} | Export-Csv -Path "./temp.csv" -NoTypeInformation
$Directory = "D:\My Source Folder"
$Shell = New-Object -ComObject Shell.Application
Get-ChildItem -Path $Directory -Recurse -Force
ForEach {
$Folder = $Shell.Namespace($.DirectoryName)
$File = $Folder.ParseName($.Name)
$Duration = $Folder.GetDetailsOf($File, 27)
[PSCustomObject]@{
Name = $.Name
Size = "$([int]($.length / 1mb)) MB"
Duration = $Duration
}
}
Export-Csv -Path "./temp.csv" -NoTypeInformation