Спасибо решил. Код нашел на одном из сайтов.
Код:
procedure ExecuteWait(const sProgramm: string; const sParams: string = ''; fHide: Boolean = false);
var
ShExecInfo: TShellExecuteInfo;
begin
FillChar(ShExecInfo, sizeof(ShExecInfo), 0);
with ShExecInfo do
begin
cbSize := sizeof(ShExecInfo);
fMask := SEE_MASK_NOCLOSEPROCESS;
lpFile := PChar(sProgramm);
lpParameters := PChar(sParams);
lpVerb := 'open';
if (not fHide) then
nShow := SW_SHOW
else
nShow := SW_HIDE
end;
if (ShellExecuteEx(@ShExecInfo) and (ShExecInfo.hProcess <> 0)) then
try
WaitForSingleObject(ShExecInfo.hProcess, INFINITE)
finally
CloseHandle(ShExecInfo.hProcess);
end;
end;
Вызываю так
Код:
ExecuteWait('BQuark.Rev.3.3.exe', 'Root.dat', true);