Solved

How to exectue another program

Posted on 1998-10-24
1
127 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best Firemonkey component pack 1 119
add combobox item based on numbers 9 154
error 1.1 400 Bad request idhttp delphi 18 150
Firemonkey webbrowser scrollbars ? 1 50
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 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