Z
Z
zanac2017-10-01 16:49:30
cmd/bat
zanac, 2017-10-01 16:49:30

Why did the bat script stop working?

Somehow I made a script for mass conversion mkv-> m4v. Principle of operation: we drag the list of files, after a while I take out the USB flash drive and that's it.
Converted the anime season successfully with a script.
Launched yesterday - the script does not work.
The script itself:

REM @echo off
SetLocal EnableDelayedExpansion

set cnt=0
set flash1=I:\VIDEO
set flash2=H:\VIDEO

if exist "%flash1%\" (
    set /A cnt=2
    set videpth=%flash1%
    echo "Set path I:\VIDEO!"
)
if exist "%flash2%\" (
    set /A cnt+=1
    echo %cnt%
    set videpth=%flash2%
    echo "Set path H:\VIDEO!"
)

if %cnt%==0 (
    goto :fail
)

FOR %%w IN (%*) DO (
    set dest="%videpth%\%%~nw.m4v"
    echo %dest%
    "D:\Program Files\ffmpeg-20140514-git-0aac9b7-win64-static\bin\ffmpeg.exe" -y -i "%%~fnxw" -map v -map 0:a -acodec copy -vcodec copy "%videpth%\%%~nw.m4v"
)

pause
goto :end

:fail
    echo "usb flash not aviable!"
    pause

:end
    pause

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kisaa, 2017-10-02
@kisaa

1. Because the flash drives were mounted under different letters
2. Because ffmpeg was updated and the path to it has changed
3. Because the source codec is not the one that the script is designed for
4. Because there is no space on the disk / flash drive
...
Well, that's enough for now guess, perhaps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question