[fpc-pascal] executeprocess help

John Lee johnelee0 at gmail.com
Wed Mar 26 13:51:39 CET 2014


This enables a process eg an .exe to be run without using cmd (unlike exec)
and if so, I'd like to use it. Can anyone provide one or two simple example
lines for using this, on windows.

Below is definition in sysutils help. It explains what path & comline do,
but doesn't really explain why one would use it vs exec. Also there is no
example of how to use texecuteflags, or oserror or exactly how to check for
an error. eg is the integer returned similar to that from exec ie doserror
and is it sufficient to check it is non 0 for error?

Maybe a simple example of its use including use of the flags and errors
could be added - Michael?

function ExecuteProcess(

  const Path: AnsiString;

  const ComLine: AnsiString;

  Flags: TExecuteFlags<http://www.freepascal.org/docs-html/rtl/sysutils/texecuteflags.html>
 = []

):Integer <http://www.freepascal.org/docs-html/rtl/system/integer.html>;

TIA
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140326/ad2184b0/attachment.html>


More information about the fpc-pascal mailing list