0

I would like to run executable file using the yuv files as an input in a specific folder using batch script. However, the above code that I am using run only a time and then stop. Could anyone help me?

>  SET /A COUNT=1
>     for /r "F:\coding\Wetlands_1920x1080p\" %%v in (*.yuv) do (
>           TAppEncoder.exe -c EBU.cfg -f 30 -i "%%v" -wdt 1920 -hgt 1080 -o %COUNT%.yuv >%COUNT%.txt
>           SET /A COUNT+=1
>           )

1 Answer 1

2
setlocal enabledelayedexpansion
SET /A COUNT=1
for /r "F:\coding\Wetlands_1920x1080p\" %%v in (*.yuv) do (
       TAppEncoder.exe -c EBU.cfg -f 30 -i "%%v" -wdt 1920 -hgt 1080 -o !COUNT!.yuv >!COUNT!.txt
  SET /A COUNT+=1
)

Within a block (a parenthesised series of statements) %var% refers to the value of var when the block was parsed. To access the run-time value, you need to invoke delayedexpansion and then use !var! to retrieve the required value.

See any number of SO items on the delayedexpansion problem. (it's very common...)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.