How to run an executable from within a c program?

How do I tell a program to immediately select an executable after being run? I'm trying to make it so that when you click on the executable file (which usually asks you to select what file you want to use), it will automatically know what to run. Help?

  • Answer:

    I'm not 100% sure, but are you asking how to set file associations? If you open an executable, it will run (execute) itself. If you open a file, it may open a program other than what you want or just sit there confused. As for file associations, I generally right-click the file, select "Open with...", tell it to remember that choice and open ALL files with that extension with teh program I select, then choose the program I want to open it with.

AtomFury at Answerbag.com Visit the source

Was this solution helpful to you?

Other answers

... create a bunch of shortcuts to the same program ... ... right click on each shortcut in turn and select 'properties' ... ... edit the command line that launches the program by adding the path and file name of the file you want to be run by the program ... ... save as what ever name you want ... ... then run the shortcuts ... __________ ... this is how I open an MP3 player program along with a certain playlist of selected songs ...

Takei-Shihan

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.