Hi. I want my file selection to be written to a file list.txt which then shall be processed one by one. I got a bat to write the selection to list.txt which looks like this:
SETLOCAL EnableDELAYedeXpansion
:Loop
IF "%1"=="" GOTO Continue
dir /s /b %1 >> "C:\Program Files (x86)\converter\list.txt"
SHIFT
GOTO Loop
:ContinueThe content of the list.txt looks like this:
D:\Downloads\video1.flv
D:\Downloads\video2.flv
D:\Downloads\video3.flvHow can I feed each line into a file called convert.bat which looks like this:
"C:\Program Files (x86)\converter\converter.exe" %1The convert.bat obviously needs the first line from list.txt as parameter %1
After converting video1.flv it should continue with the next line until list.txt is finished.
Ok so what i got now is partially working. Passing selection to write.bat which lists them inside input.txt
setlocal enabledelayedexpansion
:Loop
IF %1=="" goto continue
dir /s /b %1 >> "C:\Program Files (x86)\converter\INPUT.TXT"
SHIFT
GOTO Loop
:continue
CALL convert.batUnfortunately the CALL convert.bat does not start. Starting convert.bat manually processes the files in INPUT.TXT
@ECHO OFF
for /f "tokens=1" %%i in (INPUT.TXT) do call :userinput %%i
goto :eof
:userinput
@ECHO OFF
set SIZE=
SET FILESIZE=%~z1
SET FILENAME=%~n1
Set CURRENTDIR=%CD%
SET /a MBSIZE=(%FILESIZE%/1000000)
ECHO Das Video ist momentan %MBSIZE% MB gross.
set /P X= [1] FFMPEG [2] x264 :
if /I "%X%"=="1" SET ENC=ffmpeg
if /I "%X%"=="2" SET ENC=x264
:encode
"C:\Program Files (x86)\converter\converter.exe" -i %1 -o "C:\%FILENAME%_con.mp4" -e %ENC% -2 -T -S %FILESIZE% -E lame -B 128 -R 44.1Why wont write.bat do the CALL on convert.bat ?
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |