Solved

How to exectue another program

Posted on 1998-10-24
1
124 Views
Last Modified: 2010-04-06
Hi,

This is probably a very simple question for you experts, but I'm lost.

What command/syntax do I use to run another program (that I have created) on a button click event and close the one I ran it from?
Must I supply the path to it?

Thanks
0
Comment
Question by:edans
1 Comment
 
LVL 1

Accepted Solution

by:
borup earned 20 total points
ID: 1344179
You can do this calling the API function ShellExecute.

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShellExecute(Application.Handle,nil,'c:\command.com',nil,nil,SW_SHOWNORMAL);
Application.Terminate;
end;

Remember to include shellAPI in your uses statement.

borup
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

18 Experts available now in Live!

Get 1:1 Help Now