Delphi application calling other executables

How do I call an external executable from a Delphi application?  In BP 6.0 it was

    Exec ('filename.exe', 'Parameters')

What is it under D3?
dejohn99Asked:
Who is Participating?
 
qingangConnect With a Mentor Commented:
use the ExecuteFile function comes with delphi in FMXUtils unit
0
 
AswCommented:
Hidejohn99

Give this a shot.

To execute a standard program, simply use:

WinExec('C:\WINDOWS\NOTEPAD.EXE', SW_SHOWNORMAL);

To add a command line, use:

WinExec('C:\WINDOWS\NOTEPAD.EXE C:\WINDOWS\WIN.INI', SW_SHOWNORMAL);

To pop up a DOS box, use:

WinExec('COMMAND.COM', SW_SHOWNORMAL);

To execute a DOS command, use:

WinExec('COMMAND.COM /C DIR *.*', SW_SHOWNORMAL);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.