From fbef35d88454dc76557d7d34cc72536d2b39f25f Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 15 May 2004 19:24:59 +0000 Subject: [PATCH] - Fixed the execution of batch files. svn path=/trunk/; revision=9403 --- reactos/lib/kernel32/process/create.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index ff8158564a5..28c941c55e6 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.83 2004/05/11 20:44:29 gvg Exp $ +/* $Id: create.c,v 1.84 2004/05/15 19:24:59 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -861,6 +861,7 @@ CreateProcessW BOOL InputDup, OutputDup, ErrorDup; WCHAR Name[MAX_PATH]; WCHAR *TidyCmdLine; + BOOL IsBatchFile = FALSE; DPRINT("CreateProcessW(lpApplicationName '%S', lpCommandLine '%S')\n", lpApplicationName, lpCommandLine); @@ -939,6 +940,7 @@ CreateProcessW if (e != NULL && (!_wcsicmp(e, L".bat") || !_wcsicmp(e, L".cmd"))) { // the command is a batch file + IsBatchFile = TRUE; if (lpApplicationName != NULL && lpApplicationName[0]) { // FIXME: use COMSPEC for the command interpreter @@ -978,10 +980,11 @@ CreateProcessW * Process the application name and command line */ RtlInitUnicodeString(&ImagePathName_U, ImagePathName); - RtlInitUnicodeString(&CommandLine_U, TidyCmdLine); + RtlInitUnicodeString(&CommandLine_U, IsBatchFile ? lpCommandLine : TidyCmdLine); - DPRINT("ImagePathName_U %S\n", ImagePathName_U.Buffer); - DPRINT("CommandLine_U %S\n", CommandLine_U.Buffer); + DPRINT("ImagePathName_U '%S'\n", ImagePathName_U.Buffer); + DPRINT("lpCommandLine '%S'\n", lpCommandLine); + DPRINT("TidyCmdLine '%S'\n", TidyCmdLine); /* Initialize the current directory string */ if (lpCurrentDirectory != NULL)