Echo of time not displayed at end of batch file

36 views Asked by At

Here is my batch file:

@echo off

set start=%time%
echo %start%

for /d %%i in (*) do (
  mkdir "%1\%%i"
  cd %%i
  for %%j in (*.mp4) do (
    echo "%1\%%i\%%j
    "..\ffmpeg32" -loglevel panic -i "%%j" -c:v libx264 -preset fast-crf 50 -c:a copy -y "%1\%%i\%%j"
  )
  cd ..
)

set end=%time%
echo %start%
echo %end%

goto: eof

The time is echoed at the start. However, nothing is echoed at the end.

Output:

H:\HHVL\one-file>processandcopy.bat H:\HHVL\testdir
 9:58:41.94
"H:\HHVL\testdir\vid\vid.mp4

H:\HHVL\one-file>
1

There are 1 answers

0
Dlanod Kcud On BEST ANSWER

ffmpeg32 never returns. Add a START or CALL infront of this line.
Add a REM in front of this line just to see if the batch is executed to the last line.
Also the last line is wrong. Another clue it's just not executed completly. You would get an error message if this line would be hit. The last line must be goto :eof (note the position of the colon)