Podrías utilizar CreateProcess, y averiguar el código de salida con GetExitCodeProcess.
Código Delphi
[-]
var
StartInfo: STARTUPINFO;
ProccesInfo: PROCESS_INFORMATION;
dwExitCode: DWORD;
begin
ZeroMemory(@StartInfo, SizeOf(STARTUPINFO));
with StartInfo do
begin
cb := SizeOf(STARTUPINFO);
dwFlags := STARTF_USESHOWWINDOW;
wShowWindow := SW_HIDE;
end;
Win32Check(CreateProcess(nil, PChar('calc.exe') ,nil, nil, FALSE,
CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));
WaitForSingleObject(ProccesInfo.hProcess, INFINITE);
GetExitCodeProcess(ProccesInfo.hProcess, dwExitCode);
ShowMessageFmt('Salida: %d', [dwExitCode]);
Saludos!