Jump to content

binding two exe ?

- - - - -

  • Please log in to reply
6 replies to this topic

#1
magicpro

magicpro

    Newbie

  • Members
  • Pip
  • 2 posts
i want to bind two exe files using c code.
help me if you can

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
What is the intended result of binding them?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
magicpro

magicpro

    Newbie

  • Members
  • Pip
  • 2 posts
i want that when i run 1st exe file than 2nd exe file will autumatically run

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
You could use a batch file.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
AKMafia001

AKMafia001

    Programmer

  • Members
  • PipPipPipPip
  • 119 posts
You can awake the second file by running the first file. Put the code in your first program to execute the second.

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
fayyazlodhi

fayyazlodhi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 403 posts
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.

#7
brownhead

brownhead

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
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!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users