没有处理秒
将文件夹拖到bat上,显示正确,去掉 ren 前的 echo- @echo off
- SETLOCAL ENABLEDELAYEDEXPANSION
-
- set folder=%1
-
- pushd %folder%
- set/a time=0
- for /f "usebackq" %%a in (` dir /b *.mkv `) do (
- for /f "usebackq tokens=2,3 delims=: " %%i in (` "ffprobe.exe %%a 2>&1 | findstr Duration" `) do (
- set /a time+=%%i*60+%%j
- )
- )
- popd
-
- echo ren %folder% %folder%[%time%]
-
- pause
- exit/b
复制代码
|