Creative Commons License Foxbond's Repo

/** (c) 2011 Michał (Foxbond) Chraniuk */
#include <windows.h>
#include <tchar.h>


using namespace std;

int main(){
	
	
	
TCHAR buf[MAX_PATH];
  GetModuleFileName(0, buf, MAX_PATH);
 
  CopyFile(
    buf,
    "C:\\selfcopy.exe", // Hardwire the path\filename
    FALSE // Do not overwrite it if it already exists.
  );
 

  return 0;
  
}

> Back