Reputation: 33
I am attempting to write a batch script that processes a stack of files with an exe file. I go so far to defining variables, and I got a frame number, but I need to loop the entire sequence over for example frame 1-100 without having to generate 100 lines of entires with each its own frame number.
It looks like this now, and obviously just goes over the same frame over and over again, but it does wait, and continue on next item which is good. I am just missing the FOR loop, I belive it is, but unsure how to implement it.
SET frame= should rather be a range 1-100
I know about /l %%G IN () something...but I cant realy see how to intergrate it.
@echo off
SET noice=C:\ProgramData\Autodesk\ApplicationPlugins\MAXtoA\noice.exe
SET Path=C:\go\
SET Name=go
SET frame=0003
start /WAIT %noice% -i %Path%%Name%_AOVs%frame%.exr -o
%Path%%Name%_Denoised%frame%.exr
Upvotes: 3
Views: 48
Reputation:
Try this one.
@echo off
setlocal enabledelayedexpansion
SET "noice=C:\ProgramData\Autodesk\ApplicationPlugins\MAXtoA\noice.exe"
SET "MPath=C:\go\"
SET "MName=go"
for /l %%i in (1,1,100) do (
set "frame=%%i"
if !frame! GEQ 100 set "lframe=0!frame!"
if !frame! LEQ 99 set "lframe=00!frame!"
if !frame! LEQ 9 set "lframe=000!frame!"
echo start "" /WAIT %noice% -i %MPath%%MName%_AOVs!lframe!.exr -o %MPath%%MName%_Denoised!lframe!.exr
)
Upvotes: 1