检查错误的视频文件

问题症状:

  

实现要求:

  • 可以代替手动查找 可以递归

实现代码:

 function Get-PlayTimeEmpty ($Recurse_Dir)
{
    $comShell = New-Object -ComObject Shell.Application
    ls $Recurse_Dir -Recurse "*.mp4"|%{$_.Directoryname}|select -Unique|foreach{
    $dir = $comShell.NameSpace("$_")
    $n=($dir.Items()).count
            for($i=0;$i -lt $n;$i++){
            $file = $dir.items() | select -Index $i 
                %{if([string]::IsNullOrWhiteSpace($dir.GetDetailsOf($file,27))){$file.path}}
        }
    }
}

 效果演示:

  

原文地址:https://www.cnblogs.com/feiyucha/p/10554289.html