Board index » delphi » Executing a Batch File from Delphi 2

Executing a Batch File from Delphi 2

Can some one please give me the code to run a batch file from a Delphi 2 app
and to close down the DOS window afterwards (if it opens it).

Thanks n advance.

 

Re:Executing a Batch File from Delphi 2


On Tue, 24 Nov 1998 09:27:00 -0000, "Anthony D'Cruze"

Quote
<anth...@tamesystems.com> wrote:
>Can some one please give me the code to run a batch file from a Delphi 2 app
>and to close down the DOS window afterwards (if it opens it).

>Thanks n advance.

In NT4 its just WinExec(BatchFile.Bat,sw_shownormal);

When the batch file is finished, the dos box will close
automatically...  Not sure about 95 / 98....

Re:Executing a Batch File from Delphi 2


actually very simple... you could have delphi create the .bat file even...
that way you would only have to distribute one file.
try:

winexec(command.com /c your.bat, sw_shownormal);

the /c switch tells your command prompt to close when done.

loc

Quote
<Pa...@infosol.ie> wrote in message news:365a9eb8.9658578@news.esat.net...
>On Tue, 24 Nov 1998 09:27:00 -0000, "Anthony D'Cruze"
><anth...@tamesystems.com> wrote:

>>Can some one please give me the code to run a batch file from a Delphi 2
app
>>and to close down the DOS window afterwards (if it opens it).

>>Thanks n advance.

>In NT4 its just WinExec(BatchFile.Bat,sw_shownormal);

>When the batch file is finished, the dos box will close
>automatically...  Not sure about 95 / 98....

Other Threads