Utiliza esta función para ejecutar desde Delphi:
Código Delphi
[-]
function WinExecAndWait32(FileName:String; Visibility:integer):integer;
var
zAppName:array[0..512] of char;
zCurDir:array[0..255] of char;
WorkDir:String;
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation;
Resultado: DWord;
begin
StrPCopy(zAppName,FileName);
GetDir(0,WorkDir);
StrPCopy(zCurDir,WorkDir);
FillChar(StartupInfo,Sizeof(StartupInfo),#0);
StartupInfo.cb := Sizeof(StartupInfo);
StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow := Visibility;
if not CreateProcess(nil,
zAppName,
nil,
nil,
false,
CREATE_NEW_CONSOLE or
NORMAL_PRIORITY_CLASS,
nil,
nil,
StartupInfo,
ProcessInfo) then Result := -1
else begin
WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess,Resultado);
Result := Resultado;
end;
end;
procedure EjecutaBackupCopia;
begin
LineaLog('======= COMIENZO EJECUCION GBAK ===========================');
resultado := WinExecAndWait32(CadenaBackupCopia,SW_HIDE);
if resultado = 0 then
LineaLog('======= FINAL EJECUCION GBAK ¡ ok ! === (resultado = '+IntToStr(resultado)+')') else
LineaLog('======= LA UTILIDAD GBAK HA TERMINADO DE FORMA ERRÓNEA ====');
end;
A mi me da excelentes resultados, no se si será la solución a tu problema.