• 0
Sign in to follow this  

Reiniciar Um Serviço Do Windows 2000/xp


2 answers to this question

Recommended Posts

  • 0

uses WinSvc;
var HSC,HS:THandle; p:PChar;
  HSC := OpenSCManager(nil, nil, SC_Manager_Connect);
  HS  := OpenService(HSC, 'Nome_do_Serviço', SC_Manager_All_Access);
  p    := nil;
  StartService(HS, 0, p); // starta o serviço sem parâmetros

Se tiver parâmetros, você tem que colocar o número deles no segundo parâmetro de StartService e no PChar um array de strings terminando com #0 como última string.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this