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
Solved

Code for starting a exe file from another

Posted on 1998-12-22
5
139 Views
Last Modified: 2010-04-06
How do i do to start programs from my form.
I want to select a file with the fileopendialog and save it in the register.
start the new program and close the program where i initiated the startcommand.
0
Comment
Question by:samone
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
Tulip earned 100 total points
ID: 1352582
Let's say you want to start the file "D:\example.exe"
Then this command should work:

ShellExecute(0, 'open', 'D:\example.exe', nil, nil, SW_SHOWNORMAL);

if you want to close the first app, just use the CLOSE command
after ShellExecute.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352583
Didn't you just copy and paste that code from the question i answered a little while ago?? or maybe not??

-Viktor
--Ivanov
0
 

Expert Comment

by:Tulip
ID: 1352584
No I didn't Viktor.
That command is so common, that not only you know it !


0
 

Expert Comment

by:Tulip
ID: 1352585
No I didn't Viktor.
That command is so basic, that not only you know it !


0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352586
Sorry, I said or maybe not which means I wasn't sure and just asked u.... Anyway, Merry Christmas to all...

-Viktor
--Ivanov
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

828 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