I have two batch files, task.bat
and runtask.bat
. The runtask.bat
calls task.bat
and 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=????
task.bat
and read inruntask.bat
. Thanks very much! – Medeah