Thread: Run Executible from inside main of other executible?

  1. #1
    Registered User
    Join Date
    Sep 2007

    Run Executible from inside main of other executible?

    I was hoping someone could help me with how to link two executables. I have a executable that records data into two files. I then have another executable that parses those files into the information needed in a nice format. My plan is to convert this into one action. How do I run the parse executible from inside the 1st program?

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    For Windows, you can use ShellExecute or OpenProcess.
    But I find it just silly to have two apps. Make it into one app, if possible.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    There's an FAQ on how to run a program from within another program.

    I agree with Elysia, however -- you almost certainly don't want to do this, not the least because it might be quite difficult to communicate between the programs. If it's already set up so that you communicate with files, however, you could give it a shot.

    The simplest, and most portable, way to execute another program is with
    It might be slightly more secure (and perhaps less portable) if you use
    but system() is inherently insecure. (And slow.) But any way you execute an external program is subject to security issues.

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what to do with the main window
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 01-28-2003, 08:58 PM
  2. void main
    By Shadow in forum A Brief History of
    Replies: 15
    Last Post: 05-29-2002, 07:08 PM
  3. void main(), int main(), argc, argv[]????
    By Jonny M in forum C Programming
    Replies: 3
    Last Post: 03-06-2002, 09:12 AM
  4. why int main instead of void main?
    By Unregistered in forum C Programming
    Replies: 8
    Last Post: 10-26-2001, 10:49 PM
  5. void or int for main?:)
    By bigtamscot in forum C Programming
    Replies: 13
    Last Post: 09-27-2001, 03:11 AM