// Aus "autoexec.bat" wird "autoexec.old"
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := 'c:\autoexec.bat';
Label2.Caption := changefileext(label1.caption, '.old');
end;
// Umbennen einer Datei
procedure TForm1.Button1Click(Sender: TObject);
var f: file;
p: pchar;
begin
p := 'c:\test.bmp';
assignfile(f, p);
rename(f, changefileext(p, '.jpg'));
end;