I have two batch files, task.bat and runtask.bat. The runtask.batcalls task.batand I would like runtask.bat to get the exit code of task.bat into a variable. How could this be done?
task.bat:
@echo off
set errorlevel=1
runtask.bat
...
CMD /C task.bat
set taskexitcode=????