For /F "tokens=1" %%i in (TempJobNames.txt) do (
Executing a Command to call other application
IF %ERRORLEVEL%==0 ECHO Success
IF NOT %ERRORLEVEL%==0 ECHO Failed)
Sorry. Forgot to add the question... This code is not working. Errorlevel always returns 0 even if it's failure...
Am I missing something here ?
Thanks
"Am I missing something here ?" I ask myself that often.
If the executable doesn't set errorlevel, there's probably not much you can do about it. If it writes any result to stdout, you could work with that.
BTW you can skip the % and ==
if errorlevel 0 echo blabla
=====================================
If at first you don't succeed, you're about average.M2
Does the command only behave like this in the for loop - or always? uli
It always behaves like this...Inside loop or not it always returns 0...How can I make the executable set errorlevels ? Thanks
| « ASP.NET 2.0 / VB.NET SetF... | Dos script run in the bac... » |