Solved

shell external program

Posted on 1998-09-19
4
200 Views
Last Modified: 2010-04-06
i want to execute an external .EXE program during runing time any body please Help...

thanks
   Girsu
0
Comment
Question by:girsu
  • 2
4 Comments
 
LVL 2

Expert Comment

by:kjteng
ID: 1340223
use shellExec, execwin for win16 or
use CreateProcess for Win32
Look up the API help for more details
0
 

Author Comment

by:girsu
ID: 1340224
sorry, i'm a VB programmer this is the first time i write a program by Delphi could ypu please send an example... i'll be thanks


thanks
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1340225
Hi Girsu

A good way is to use the ShellExecute API.  (Add ShellApi to your form's "uses" clause.)

E.g. to run notepad:
ShellExecute(Self.Handle, 'open', PChar('C:\Windows\Notepad.exe'), nil, nil, SW_NORMAL);

You can change the nils to PChar('Some string') if you want to pass in a parameter (first nil) or set the working folder (second nil).

The great thing about ShellExecute is that you don't have to use a EXE program.  You can ShellExecute any file, e.g. MyWordDoc.doc, etc.

Cheers,
JB
0
 

Author Comment

by:girsu
ID: 1340226
thanks JimBob good answer...
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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

912 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