errorlevel in a for
Posted: 07 Oct 2011 13:43
Hi
this problem makes me crazy
wavi.exe is a command line tool that write to sdterr and return errorlevel 0 in case of success
so this works:
and this:
works perfectly but errorlevel keep the value it has before the loop
So I can't guess if my command worked or not.
Is this due to the loop. How should I do?
Thanks for help!
colargol
this problem makes me crazy

wavi.exe is a command line tool that write to sdterr and return errorlevel 0 in case of success
so this works:
Code: Select all
wavi.exe test.avs 2>&1
echo %errorlevel%
and this:
Code: Select all
for /f "usebackq tokens=4 delims=,: " %%a in (`"wavi.exe test.avs 2>&1"`) do (
echo channels=%%a
)
echo %errorlevel%
So I can't guess if my command worked or not.
Is this due to the loop. How should I do?
Thanks for help!
colargol