Solved

Delphi application calling other executables

Posted on 1998-10-05
2
201 Views
Last Modified: 2010-04-06
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?
0
Comment
Question by:dejohn99
2 Comments
 

Accepted Solution

by:
qingang earned 50 total points
ID: 1341812
use the ExecuteFile function comes with delphi in FMXUtils unit
0
 
LVL 1

Expert Comment

by:Asw
ID: 1341813
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now