아래와 같이 실행파일 *.exe를 복사하고 바루 실행 하면 실행이 되질 않습니다.
파일이 정상으로 복사 된것 확인 됬구요
복사 Function을 거치지 않으면 정상으로 실행 됩니다.
복사시 Lock문제인거 같은데 잘풀리지 않네요.
조언 부탁드립니다.
//File Copy Function
function TfVerctrl.fFileCopy(vFrom, vTodir, vTofile : String) : boolean;
var
 Copybuffer : Pointer;
 From, Dest : Integer;
 BytesCopied, processing, size, FProcessed : Longint;
 F : File of Byte;
 vAttributes : Word;
const ChunkSize : Integer = 8192;
begin
   Result := false;
   if not fileexists(vFrom) then begin
      showmessage('From File Not Found Error' + '(' + vFrom + ')');
      exit;
      end;
   if vTodir = '' then exit;
   if vTofile = '' then exit;
   { Directory Create}
   if not gIsDir(vTodir) then begin
      if not fMkdir(vTodir) then begin
         showmessage('Directory Create Error' + '(' + vTodir + ')');
         exit;
         end;
      end;
   { file Get Attribute}
   vAttributes := FileGetAttr(vFrom);
   { Compute the length of the FCopyFrom file }
   assignfile(F, vFrom);
   try
     reset(F);
     Size := FileSize(F); {The length of the file}
   finally
     closefile(F);
   end;
   { Show the progressform if this is what the user wants }
   GetMem(Copybuffer, Chunksize);
   From := FileOpen(vFrom, fmShareDenyWrite);
   Dest := FileCreate(vTodir + '' + vTofile);
   {게이지 초기화}
.
.
.
.
   repeat
     BytesCopied := FileRead(From, Copybuffer^, ChunkSize);
     if BytesCopied > 0 then begin
       FileWrite(Dest, Copybuffer^, BytesCopied);
       {게이지 Prograss}
.
.
.
.
       end;
   until BytesCopied = 0;
   FreeMem(Copybuffer);
   { file Set Attribute}
   FileSetAttr(vTodir + '' + vTofile, vAttributes);
   
.
.
   Result := true;
end;
//실행부분...
         ShellExecute(handle, 'open', pchar('*.exe'), nil, nil, SW_SHOWNORMAL);
다소 코딩이 엉성하더라두 이해해 주시면 감사하겠습니다.
언제나 고수님들께 도움만 받는 델 초보가.....
			 
	
	
    
    
	
	
    
    
    
Application.ProcessMessages;
// sleep(100);
ShellExecute(handle, 'open', pchar('*.exe'), nil, nil, SW_SHOWNORMAL);