Link to home
Start Free TrialLog in
Avatar of ZafodBiblbrox
ZafodBiblbrox

asked on

How can i rename directory from Delphi program ?

How can i rename directory from Delphi program ?


thanx
Zafod
ASKER CERTIFIED SOLUTION
Avatar of aubs
aubs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZafodBiblbrox
ZafodBiblbrox

ASKER

i thought that RenameFile function rename only file.

thanx
Hi Zafod!!
Look, Instead "RenameFile" you can try something like this:

Just Use MoveFile to rename existing directory.


procedure TForm1.Button1Click(Sender: TObject);
var
  st1, st2: PChar;
begin
  st1:='c:\OldDirectory';
  st2:='c:\NewDirectory';
  MoveFile(st1, st2);
end;