Solved

How to exectue another program

Posted on 1998-10-24
1
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 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