Like Tree1Likes
  • 1 Post By iMalc

How can i open a .exe file from my c++ program?

This is a discussion on How can i open a .exe file from my c++ program? within the C++ Programming forums, part of the General Programming Boards category; I am wondering how can i open a .exe file with my c++ program. Could some one give me the ...

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    4

    Unhappy How can i open a .exe file from my c++ program?

    I am wondering how can i open a .exe file with my c++ program. Could some one give me the source code?

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    2,332

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    62
    just out of curiosity, how would I do something like this in non-windows operating systems?

  4. #4
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    Same.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    2,569
    Quote Originally Posted by killme View Post
    just out of curiosity, how would I do something like this in non-windows operating systems?
    I suggest reading this for other options under Linux.
    c - Difference between "system" and "exec" in Linux? - Stack Overflow

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  6. #6
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    And a Windows specific alternative:

    ShellExecute function (Windows)
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  7. #7
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    Of course it all depends on what you mean by opening an exe. One can open an exe for reading in the same way one opens a data file. A hes editor would do this, for example.

    Generally the terms such as "launch", "start" or "run" are used to indicate that you want the program to execute.
    Elysia likes this.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-20-2011, 12:36 PM
  2. How to open file from program's dir
    By Abda92 in forum C Programming
    Replies: 6
    Last Post: 07-29-2007, 10:23 PM
  3. Open file with program by default..
    By willc0de4food in forum Windows Programming
    Replies: 8
    Last Post: 09-18-2005, 03:50 PM
  4. change this program to open a file
    By A F Army in forum C Programming
    Replies: 3
    Last Post: 04-05-2003, 04:25 PM
  5. get program to open a html file
    By task in forum C Programming
    Replies: 14
    Last Post: 11-09-2001, 11:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21