program Project1;
uses Windows, ShellApi;
function MoveDir(const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
fos.wFunc := FO_MOVE;
fos.fFlags := FOF_NOCONFIRMMKDIR + FOF_RENAMEONCOLLISION;
fos.pFrom := PChar(fromDir + #0);
fos.pTo := PChar(toDir);
Result := ShFileOperation(fos) = 0;
end;
begin
...
if not MoveDir('C:\Folder_A', 'C:\Folder_B\SubFolder_B\Folder_A') then
Writeln('Error moviendo directorio');
...
end.