Не будет работать WinExec в Вашем случае. Копирование же проще сделать самому.
{Sample code for the BlockRead and BlockWrite procedures.}
program CopyFile;
{ Simple, fast file copy program with NO error-checking }
{ For Windows: } { uses WinCrt; }
var FromF, ToF: file; NumRead, NumWritten: Word; Buf: array[1..2048] of Char; begin Assign(FromF, ParamStr(1)); { Open input file } Reset(FromF, 1); { Record size = 1 } Assign(ToF, ParamStr(2)); { Open output file } Rewrite(ToF, 1); { Record size = 1 } Writeln('Copying ', FileSize(FromF), ' bytes...'); repeat BlockRead(FromF, Buf, SizeOf(Buf), NumRead); BlockWrite(ToF, Buf, NumRead, NumWritten);
until (NumRead = 0) or (NumWritten <> NumRead); Close(FromF); Close(ToF); end.
|