Board index » cppbuilder » Manually execute an EXE File

Manually execute an EXE File


2003-08-17 06:51:02 PM
cppbuilder36
Hi! I want to know, how can I manually execute an executable (.EXE) file
without using C++ inbuilt functions
such as exec..., system( ), spawn... etc.
Thanks!
Henry
 
 

Re:Manually execute an EXE File

When you ask a question about using the compiler, please mention what
version of the compiler you are using. While I know you are using Borland
C++ and not Turbo C, Turbo C++ or C++ Builder because you have posted in the
Borland C++ newsgroup, I do not know which version and that information
alters what the answer would be.
Using the word "manually" implies that you want to execute it from the
command line. To do that type in the name of the file. Including the .exe
in the name is optional.
If what you want to do is to execute it from within a Windows program then
there are other functions that can be used. In 16 bit Windows programs you
can use WinExec. If running a 32 bit Windows program you can use WinExec,
CreateProcess or ShellExecute. If it is a DOS program then running another
program is quite complex and it is better to let the system or one of the
exec* or spawn* sets of functions handle the details.
. Ed
Quote
Henry wrote in message
news: XXXX@XXXXX.COM ...

Hi! I want to know, how can I manually execute an executable (.EXE) file
without using C++ inbuilt functions
such as exec..., system( ), spawn... etc.