i want to bind two exe files using c code.
help me if you can
6 replies to this topic
#1
Posted 05 June 2011 - 02:11 PM
|
|
|
#3
Posted 05 June 2011 - 02:24 PM
i want that when i run 1st exe file than 2nd exe file will autumatically run
#4
Posted 05 June 2011 - 03:04 PM
You could use a batch file.
#5
Posted 06 June 2011 - 03:14 AM
You can awake the second file by running the first file. Put the code in your first program to execute the second.
Don't forget to include <windows.h>.
Hope That Helped!
system("Drive:\\Path\\Second.exe");
If the file you want to open is in the same place or folder where the first file exists, then you can simply mention it's name without specifying the path.
system("second.exe");
Don't forget to include <windows.h>.
Hope That Helped!
#6
Posted 06 June 2011 - 01:31 PM
In case you are on Linux since OS was not mentioned, it is better to use a combination of fork and exec calls rather than using system.
System command essentially is doing from with in the program what you would manually do on the command line i.e. what you pass to it is executed on a command shell.
fork creates a child process and exec API takes a new executable path/name as parameter which it will initiate in the newly created process.
I believe some close equivalent API should be existent on windows though i haven't personally used it.
System command essentially is doing from with in the program what you would manually do on the command line i.e. what you pass to it is executed on a command shell.
fork creates a child process and exec API takes a new executable path/name as parameter which it will initiate in the newly created process.
I believe some close equivalent API should be existent on windows though i haven't personally used it.
#7
Posted 09 June 2011 - 03:03 AM
Though you mention you would like to do it in C, I think you may want to consider doing it in another language -- one a bit more accustomed to working with very high level things like whole programs. WingedPanther suggested using a Batch file which would be excellent. You could also use Python, which would allow your script to work in any operating system. Doing this in C would be a little strange.
Good luck with whatever you decide to do!
Good luck with whatever you decide to do!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









