How immediately start a service after its installation?

{ To automatically start a service after its installation use this code }
procedure TMyService.ServiceAfterInstall(Sender: TService);
var
 sm: TServiceManager;
begin
 sm := TServiceManager.Create;
 try
  if sm.Connect then
  if sm.OpenServiceConnection(self.name) then
  sm.StartService;
 finally
  sm.Free;
 end;
end;

Взято с сайта http://www.swissdelphicenter.ch/en/tipsindex.php

Отправить комментарий

Проверка
Антиспам проверка
Image CAPTCHA
...