Getting MSDos ErrorLevel

BlitzPlus Forums/BlitzPlus Programming/Getting MSDos ErrorLevel

Is there a way to get the MSDos %ErrorLevel% variable after calling a process via ExecFile? I just need to know if the program i'm calling has completed successfully. I *think* the current return code from ExecFile indicates if the .exe was executed (valid file path)?

Or, as the ErrorLevel is just the return code from the app itself, is there a way to get this?

Thanks
J

If you use :
command$="cmd.exe /c echo %errorlevel%"
a=CreateProcess (command$)

While Not Eof(a) ; repeat loop until process has ended
d$=ReadLine(a)

DebugLog (d$)

Wend
notify "done"

Should do the trick.

api_CreateProcess take about nine parameters. Where are the rest? Or do you mean ExecFile?