Ok, now I'm really confused!   How come

ExecuteApplication('.', 'DosExec.bat', 'C:\ pcli ListVersionedFiles
-pr"G:\PVCS\Projects" -aw "/General Library - Delphi 4/CubeView"');

works, but

ExecuteApplication('.', 'DosExec.bat', 'C:\ pcli ListVersionedFiles
-pr"G:\PVCS\Projects" -aw "/General Library - Delphi 4/CubeView"');

doesn't?  Ie. in the second case, the batch file doesn't even get run?
(In case you missed it, there are two spaces between
'ListVersionedFiles' and '-pr"' in the line that doesn't).

Cheers,

Carl Reynolds                      Ph: +64-9-4154790
CJN Technologies Ltd.             Fax: +64-9-4154791
[EMAIL PROTECTED]                DDI: +64-9-4154795
PO Box 302-278, North Harbour, Auckland, New Zealand
12 Piermark Drive, North Harbour Estate, Auckland, NZ
Visit our website at http://www.cjntech.co.nz/

> -----Original Message-----
> From: Carl Reynolds 
> Sent: Thursday, July 29, 1999 4:42 PM
> To:   Multiple recipients of list delphi
> Subject:      Problems with CreateProcess
> 
> I'm having difficulties trying to execute a dos batch file.  The
> function I'm using to run it is
> 
> function ExecuteApplication(PPath, PFileName, PParameters : String):
> Boolean;
> var   LStartUp: TStartupInfo;
>       LProcess: TProcessInformation;
> begin
>       Result := True;
>       try
>               FillChar(LStartUp, SizeOf(LStartUp), 0);  // Crude, I
> know
>               LStartUp.cb := SizeOf(LStartUp);
>               Win32Check (
>                       CreateProcess (
>                               PChar(PFileName)
>                               , PChar(PFileName + ' ' + PParameters)
>                               , nil
>                               , nil
>                               , True
>                               , 0, nil
>                               , PChar(PPath)
>                               , lStartUp
>                               , lProcess
>                       )
>               );
>               CloseHandle(LProcess.HThread);
>               WaitForSingleObject(LProcess.HProcess, INFINITE);
>               CloseHandle(LProcess.HProcess);
>       except
>               Result := False;
>       end;
> end;
> 
> This was working fine until I changed the last parameter in my
> parameter string to be a bit longer (from "/Cubeview" (including
> quotes) to "/General Library - Delphi 4/Cubeview").  It's still only
> about 100 chars.  Now it doesn't run the batch file at all - it just
> pops up a DOS window with a command prompt, and waits for you to type
> something in!  Not even "echo hello" gets run.  What did I do wrong?!
> 
> Cheers,
> 
> Carl Reynolds                      Ph: +64-9-4154790
> CJN Technologies Ltd.             Fax: +64-9-4154791
> [EMAIL PROTECTED]                DDI: +64-9-4154795
> PO Box 302-278, North Harbour, Auckland, New Zealand
> 12 Piermark Drive, North Harbour Estate, Auckland, NZ
> Visit our website at http://www.cjntech.co.nz/

application/ms-tnef

Reply via email to