如何列出資料夾下所有影片長度 - Windows
By Leila
at 2014-07-22T17:23
at 2014-07-22T17:23
Table of Contents
把以下內容存成 *.ps1 ,放到影片旁邊
對著ps1檔按右鍵 → 用PowerShell執行
win8測過可以,希望 win7也可以
===================================================
$Shell = New-Object -Com "Shell.Application"
dir *.wmv | % {
$File = $Shell.NameSpace($_.DirectoryName).ParseName($_.Name)
$Duration = $File.ExtendedProperty("Duration")
if ($Duration -ne $null ) {
$T = New-TimeSpan -Seconds ($Duration / (1000*1000*10) )
$Time = $T.tostring()
} else {$Time = ""}
"$Time " + $_.name
# 多加的,如果有人需要的話
# $Width = $File.ExtendedProperty("System.Video.FrameWidth")
# $Height = $File.ExtendedProperty("System.Video.FrameHeight")
# WMV之外的影片,系統可能需要裝Codec (不確定…)
# 如果副檔名給錯的話,可能會顯示不出來
# 例如,容器是mp4,副檔名卻用avi
} > 影片時間.txt
ii 影片時間.txt
--
對著ps1檔按右鍵 → 用PowerShell執行
win8測過可以,希望 win7也可以
===================================================
$Shell = New-Object -Com "Shell.Application"
dir *.wmv | % {
$File = $Shell.NameSpace($_.DirectoryName).ParseName($_.Name)
$Duration = $File.ExtendedProperty("Duration")
if ($Duration -ne $null ) {
$T = New-TimeSpan -Seconds ($Duration / (1000*1000*10) )
$Time = $T.tostring()
} else {$Time = ""}
"$Time " + $_.name
# 多加的,如果有人需要的話
# $Width = $File.ExtendedProperty("System.Video.FrameWidth")
# $Height = $File.ExtendedProperty("System.Video.FrameHeight")
# WMV之外的影片,系統可能需要裝Codec (不確定…)
# 如果副檔名給錯的話,可能會顯示不出來
# 例如,容器是mp4,副檔名卻用avi
} > 影片時間.txt
ii 影片時間.txt
--
Tags:
Windows
All Comments
Related Posts
win8 IP轉換
By Jacob
at 2014-07-22T11:15
at 2014-07-22T11:15
可以移動MBR到另外一顆硬碟嗎?
By Oscar
at 2014-07-22T09:52
at 2014-07-22T09:52
請問一下,為什麼重開機之後網頁變怪怪的
By Barb Cronin
at 2014-07-22T06:19
at 2014-07-22T06:19
資料夾裡的欄寬
By Candice
at 2014-07-22T00:38
at 2014-07-22T00:38
疑似被利用C$的方式進入,有辦法查出來嗎
By Donna
at 2014-07-21T17:43
at 2014-07-21T17:43