[fpc-pascal] TProcess, Batch script and Windows

Marcos Douglas md at delfire.net
Thu May 16 18:49:46 CEST 2013


On Thu, May 16, 2013 at 12:51 PM, Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
> On Wed, 15 May 2013, Marcos Douglas wrote:
>
>> Hi,
>>
>> I want to execute a batch file on Windows (FPC 2.6.2 and Laz trunk)
>> using TProcess class.
>> It ONLY works if I use the [poWaitOnExit] and DO NOT USE [poNoConsole]
>> options.
>>
>> I do not want to see the console so, I need to use [poNoConsole]
>> option. Is this a bug?
>
>
> As far as I know, batch files need CMD and that needs a console ?

I saw then:
http://www.freepascal.org/docs-html/fcl/process/tprocess.options.html

poNoConsole = Do not allow access to the console window for the
process (Win32 only)

So the "correct" is do not use poNoConsole!

I saw after:
http://www.freepascal.org/docs-html/fcl/process/tprocess.showwindow.html

TProcess.ShowWindow = Determines how the process main window is shown
(Windows only)

I do not understood why the interface of TProcess have a property that
only works on Windows... but works.

Thank you anyway.
Marcos Douglas



More information about the fpc-pascal mailing list