program to run another program with certian files

Hello,
I'm currently trying to write a program to take these files I have (games), and run them with an emulator. The questions I have are:
How can i say, run [x.exe] with [y.filetype]?
can I include [x.exe] in my program?
can I include the game files in my program?
how would the above two statements affect preformance?
I currently have a simple, ufinished program with the filenames in it. It displays them and I'm using a switch to execute it (run x with y).

Any suggestons, tips, and help are appreciated.
Thanks again cplusplus,
enduser000
Are U trying to execute another executable from ur program with certain parameters to that executable??

If that is the case then I think exec**() may help you.
yeah, i want to open (file) with (executable) on the user's prompt (using a switch for a menu), what header does exec() use?
Try to use
system("PATH_OF_EXECUTABLE FILE_PATH");

Make sure that the PATH_OF_EXECUTABLE and FILE_PATH are enclosed in a double quote.
Last edited on
should I change this c:\file.exe to c:_file.exe? because it's not liking the first one. it thinks it's supposts be a charcter escape sequence
that seems to work and it compiles. the switch works good, everything's lined up but, now says: C:_folder_emulator.exe is not reconized as an operable batch file or exe. should I have changed it to C:_ for the path?
Last edited on
alright, n00b mistakes... forgot about escape characters, using C:\\folder now instead of C:_folder. it runs good and brings up the emulator, but now I'm having problems opening the emulator with the game file. path and filenames are correct, is theis the correct syntax?
system("C:\\folder\\emulator.exe C:\\folder\\games\\game_1.type");

??

thanks
Hey,
Thanks DiptenduDas, and cplusplus, got it done. The system() command (you all probably know this) just runs the command, i this case, myprogram myfile, in the command prompt. Spaces were my problem, cmd.exe cannot understnde that f i l e.txt is a text file so thats where I messed up. Until later,
enduser000
Topic archived. No new replies allowed.