We had a similar problem with a shortcut to an Access database. The directory
name contained a hyphen, and the shortcut would not work until (in
desperation) we put two spaces between the directory name (contained in
quotation marks) and the rest of the command line.

John Mason
Kingston Morrison


Carl Reynolds wrote:

> 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/
>
>   ------------------------------------------------------------------------
>
>    Part 1.2    Type: application/ms-tnef
>            Encoding: base64

--

John Mason
Kingston Morrison


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to