BOOL CopyFile( LPCTSTR lpExistingFileName LPCTSTR lpNewFileName, BOOL bFailIfExists );



lpExistingFileName : 원본파일의 경로

lpNewFileName : 복사될파일의 위치

bFailfExitsts : 파일이 이미 존재하면 덮어쓸지 유무, FALSE옵션을주면 덮어씀,                                TRUE를 주면 덮어쓰지 않음.


ex)


#include<stdio.h>

#include<Windows.h>


int main()

{

char path[]="C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2010\\Projects\\bad_code\\Debug\\FileName.exe";

char new_path[]="C:\\bad_code.exe";

CopyFile(path,new_path,false);

return 0;

}


'System > Windows' 카테고리의 다른 글

Message HOOK - Window  (0) 2012.08.20
CreateProcess  (2) 2012.08.03
WinAPI 레지스트리  (0) 2012.07.27
WinApi MessageBox  (0) 2012.07.26
CreateWindow  (0) 2012.07.26

+ Recent posts