[CMD] Wait for the spawned application to exit while executing a batch script. Patch...
authorMark Jansen <mark.jansen@reactos.org>
Thu, 17 Nov 2016 20:47:23 +0000 (20:47 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 17 Nov 2016 20:47:23 +0000 (20:47 +0000)
svn path=/trunk/; revision=73246

reactos/base/shell/cmd/cmd.c

index 3c5914c..b6e09e3 100644 (file)
@@ -442,8 +442,9 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
 
         if (prci.hProcess != NULL)
         {
-            if (IsConsoleProcess(prci.hProcess))
+            if (bc != NULL || IsConsoleProcess(prci.hProcess))
             {
+                /* when processing a batch file or starting console processes: execute synchronously */
                 EnterCriticalSection(&ChildProcessRunningLock);
                 dwChildProcessId = prci.dwProcessId;