We help IT Professionals succeed at work.

How can i rename directory from Delphi program ?

ZafodBiblbrox
on
Medium Priority
1,066 Views
Last Modified: 2007-12-19
How can i rename directory from Delphi program ?


thanx
Zafod
Comment
Watch Question

Commented:
Have a look at the RenameFile function.

Aubs

Author

Commented:
i thought that RenameFile function rename only file.

thanx

Commented:
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;