22-04-2013, 10:55 AM
اهلا أخي ELARAPY
كود :
var
OldN : TSearchRec;
NewN, Path : String;
begin
Path := 'C:\Temp\';
if FindFirst(Path+'*.*', faArchive, OldN) = 0 then
begin
repeat
NewN := OldN.Name;
if (UpperCase(NewN[1]) = 'I') and (UpperCase(NewN[2]) = 'D') then
Delete(NewN,1,2);
if (NewN[1] = '0') and (NewN[2] = '0') then
Begin
Delete(NewN,1,2);
Delete(NewN,Length(NewN)-3,4);
NewN := NewN+'.meg';
End;
ReNameFile(Path + OldN.Name ,Path + NewN);
until FindNext(OldN) <> 0;
FindClose(OldN);
end;
end;
