Sorry Ed - there must have been a miscommunication somewhere.
From your original post, you appeared to claim that the errorlevel was propagated outside of the FOR IN() clause back to the parent if executed from the command line.
Ed Dyreen wrote:'
From the command shell, taskkill returns errorlevel 128
[code]
prompt $_$G
>for /f "usebackq delims=" %? in (`taskKill.EXE /t /f /im "%%~a" 2^>^&1`) do echo.?=%?_
>echo.?=Fout: het proces %~a is niet gevonden._
?=Fout: het proces %~a is niet gevonden._
>echo.%errorlevel%
128
>
That is what I was referring to when I said you must have fooled yourself. The error 128 above could not have come from the FOR IN(taskKill). It must have come from a prior command.
Then in your next to last post you provided an example showing taskKill returning error 128 when not executed within FOR IN(). Of course that will work, but it doesn't address the point I was making. So I thought you were still confused.
Now based on your last post it sounds like you understand the point I was making.
I really wasn't trying to mislead or tease you. Based on my interpretation of your posts, I thought you were confused about the significance of executing a command within a FOR IN() with regard to errorlevel.
Dave Benham