Board index » delphi » Executing a DOS program from a Delphi App

Executing a DOS program from a Delphi App

Hi,

I'd like to execute an old DOS program, with arguments, from my Delphi apps
to perform a file conversion. The dos command would look like:

C:\>C:\foobar\yahoo.exe c:\foo\file1 c:\bar\file2

Can anyone tell me how to do this? And to go one step further, make the
program console window disappear when it's done.

Many Thanks,

Dave Inskeep
sk...@gwis.com

 

Re:Executing a DOS program from a Delphi App


Maybe someone could help you if they knew which version of Delphi you
are using.

--
Lonny A. Eachus   *   CONSULTECH Computer Services   *
              Mailto:l...@iea.com
    WWPager:  http://www.mirabilis.com/244930

Quote
Dave Inskeep wrote:

> Hi,

> I'd like to execute an old DOS program, with arguments, from my Delphi apps
> to perform a file conversion. The dos command would look like:

> C:\>C:\foobar\yahoo.exe c:\foo\file1 c:\bar\file2

> Can anyone tell me how to do this? And to go one step further, make the
> program console window disappear when it's done.

> Many Thanks,

> Dave Inskeep
> sk...@gwis.com

Re:Executing a DOS program from a Delphi App


Hi,

This is an update to my question, I'm using Delphi 2.0 on Windows 95. Sorry
for leaving out the important info!

tia,
Dave Inskeep

Quote
> Hi,

> I'd like to execute an old DOS program, with arguments, from my Delphi apps
> to perform a file conversion. The dos command would look like:

> C:\>C:\foobar\yahoo.exe c:\foo\file1 c:\bar\file2

> Can anyone tell me how to do this? And to go one step further, make the
> program console window disappear when it's done.

> Many Thanks,

> Dave Inskeep
> sk...@gwis.com

Re:Executing a DOS program from a Delphi App


Use ShellExecute performed on the shortcut. That shortcut must have set "Close
on Exit". In NT you would execute executable directly.

Quote
sk...@gwis.NOSPAM.com (Dave Inskeep) wrote:
>This is an update to my question, I'm using Delphi 2.0 on Windows 95.
>> I'd like to execute an old DOS program, with arguments, from my Delphi apps
>> to perform a file conversion.

Lester

lko...@ottawa.com
http://www.{*word*104}us.ca/~lkovac/lester.htm

Re:Executing a DOS program from a Delphi App


In article <skeep-ya02408000R2007971227260...@news.gwis.com> sk...@gwis.NOSPAM.com (Dave Inskeep) writes:
.>From: sk...@gwis.NOSPAM.com (Dave Inskeep)
.>Subject: Re: Executing a DOS program from a Delphi App
.>Date: 20 Jul 1997 16:24:09 GMT
.
.>Hi,
.
.>This is an update to my question, I'm using Delphi 2.0 on Windows 95. Sorry
.>for leaving out the important info!
.
.>tia,
.>Dave Inskeep
.
.>> Hi,
.>>
.>> I'd like to execute an old DOS program, with arguments, from my Delphi apps
.>> to perform a file conversion. The dos command would look like:
.>>
.>> C:\>C:\foobar\yahoo.exe c:\foo\file1 c:\bar\file2
.>>
.>> Can anyone tell me how to do this? And to go one step further, make the
.>> program console window disappear when it's done.
.>>
.>> Many Thanks,
.>>
.>> Dave Inskeep
.>> sk...@gwis.com
*** I'd imagine it works the same way in D2/Win95 as it did in the older
versions, try:

uses Winprocs;

begin
  WinExec ('C:\foobar\yahoo.exe c:\foo\file1 c:\bar\file2', SW_SHOWNORMAL);
end.

Other Threads