Add an external exe file to my C++ program

Hi

I have a program1 which is like this and created as test.exe

#include <windows.h>

using namespace std;
int public(int argc, char *argv[]);
{

system("ping -l 512 -t 127.0.01");
return 0;
}



I want to add test.exe file to my program2 . for example

#include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <windows.h>

using namespace std;

int main(int argc, char *argv[])
{
system("copy test.exe c:\\");
return 0;
}


in the above example test.exe is an external exe file which i want to copy to c drive.I have already made test.exe which is located in an another direcory on my hdd. Now I want this program to copy test.exe to c drive of any computer where ir is run.


Last edited on
If you are trying to create an installer, check out Inno Setup. It is very good.

Otherwise, you'll need to do something like use resources. (Google "msdn resource functions".)

Good luck!
I am using dev c++ how to do the above with this
Topic archived. No new replies allowed.