[CMD] Cleanup all batch contexts if the execution loop stopped due to EXIT.
[reactos.git] / base / shell / cmd / batch.c
index 671be41..36600cd 100644 (file)
@@ -478,6 +478,11 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd)
         ret = ExecuteCommandWithEcho(Cmd);
         FreeCommand(Cmd);
     }
+    if (bExit)
+    {
+        /* Stop all execution */
+        ExitAllBatches();
+    }
 
     /* Perform top-level batch cleanup */
     if (!bc || bTopLevel)