A parent batch file runs a child batch file, then records the child's exit status and continues processing. Which practices support this behavior under cmd.exe? (Choose three.)
Choose 3 answers
Show the answer
Correct answersA. Save %ERRORLEVEL% immediately after the child returnsB. End the child with EXIT /B and its statusC. Invoke the child batch file using CALL
AWhy this is right: Saving %ERRORLEVEL% promptly preserves the child's status before later commands can change it.
BWhy this is right: EXIT /B returns from the child batch context and can supply an exit status without closing the command interpreter.
CWhy this is right: CALL invokes another batch file while allowing execution to resume in the parent.
DWhy not this: $LASTEXITCODE is a PowerShell variable, not cmd.exe batch syntax.
EWhy not this: Direct invocation transfers batch execution to the child instead of establishing a return to the parent.
CALL returns control to the parent, %ERRORLEVEL% exposes the child's exit status, and EXIT /B exits the child without closing cmd.exe. Invoking another batch file directly transfers control without providing the required return.