Open a .exe file.

This is a discussion on Open a .exe file. within the C++ Programming forums, part of the General Programming Boards category; so is there a function that opens a .exe file? And another thing, in windows vista and seven, how do ...

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    151

    Question Open a .exe file.

    so is there a function that opens a .exe file? And another thing, in windows vista and seven, how do you get a program to show up as a program when using the search box.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by bijan311 View Post
    so is there a function that opens a .exe file?
    You can "open" it the same as any file -- using fopen() or std::ifstream...
    You can "run" it using system().

    Quote Originally Posted by bijan311 View Post
    And another thing, in windows vista and seven, how do you get a program to show up as a program when using the search box.
    I'm not sure what you mean by this?
    If you compile it into a .exe file, it's a program isn't it?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    Grey Wizard C_Sparky's Avatar
    Join Date
    Sep 2009
    Posts
    50
    Use WinExec() or ShellExecute()

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,428
    Quote Originally Posted by cpjust View Post
    I'm not sure what you mean by this?
    If you compile it into a .exe file, it's a program isn't it?
    I assume it means that the OP wants the program to show up when searching in the start-menu.
    And the answer to that is to make a short-cut in the start-menu to your program.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-27-2009, 12:46 PM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM

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