Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Renombrar Carpeta (https://www.clubdelphi.com/foros/showthread.php?t=75376)

Paulao 18-08-2011 14:03:30

Renombrar Carpeta
 
Como hago para renombrar carpetas? Uso Delphi XE. Esta rutina abajo no funciono.

Código Delphi [-]
use SHELLAPI;

procedure TFileFinder.RenameDir(DirFrom, DirTo: string);
var
  shellinfo: TSHFileOpStruct;
begin
  with shellinfo do
  begin
    Wnd := 0;
    wFunc := FO_RENAME;
    pFrom := PChar(DirFrom);
    pTo := PChar(DirTo);
    fFlags := FOF_FILESONLY or FOF_ALLOWUNDO or
    FOF_SILENT or FOF_NOCONFIRMATION;
  end;
  SHFileOperation(shellinfo);
end;

ecfisa 18-08-2011 14:16:25

Hola Paulao.

Código Delphi [-]
 
  RenameFile('C:\Viejo nombre','C:\Nuevo nombre');

Saludos.


La franja horaria es GMT +2. Ahora son las 20:29:23.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi