```The errorlevel is 0 always. Even when using sys.exit (4) in the script.
How can I get the return code from the script running in CoDeSys, into my batch file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-17
Originally created by: M.Schaber
Hi, Edwin,
Edwin hat geschrieben:
Does CoDeSys return an errorlevel, when using --runscript?
I use (in a batch file): "%CoDeSysPath%\CoDeSys.exe" --profile="CoDeSys V3.5 Patch 4" --noUI --runscript="script1.py"
echo %errorlevel%The errorlevel is 0 always. Even when using sys.exit (4) in the script.
How can I get the return code from the script running in CoDeSys, into my batch file?
If you use system.exit(4), it should work.
CDS-30366 in our tracker, so this will be fixed eventually.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does CoDeSys return an errorlevel, when using --runscript?
I use (in a batch file):
```
"%CoDeSysPath%\CoDeSys.exe" --profile="CoDeSys V3.5 Patch 4" --noUI --runscript="script1.py"
echo %errorlevel%
```The errorlevel is 0 always. Even when using sys.exit (4) in the script.
How can I get the return code from the script running in CoDeSys, into my batch file?
Originally created by: M.Schaber
Hi, Edwin,
If you use system.exit(4), it should work.
CDS-30366 in our tracker, so this will be fixed eventually.
I replaced
with
And it is working successful. The batch command retrieves the correct errorlevel.
Thank you for your help.