procedure LoadPerfCounter(); var Ret : Integer; begin if Exec(ExpandConstant('{sys}') + 'lodctr.exe', '/m:test.man', ExpandConstant('{app}') ,SW_HIDE, ewWaitUntilTerminated, Ret) then begin if Ret <> 0 then begin MsgBox('Error when loading performance counters.' + #13#10 + SysErrorMessage(Ret), mbError, MB_OK); end; end; end;