Re: Stopping vb services

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jim (notKnown_at_this.address)
Date: 12/15/04


Date: Wed, 15 Dec 2004 12:23:36 GMT


"Jm" <jarrodm@ihug.com.au> wrote in message
news:cpethh$74s$1@lust.ihug.co.nz...
> Hi All
>
> Is there a better way to stopping a vb service rather than just saying end
> in your code ?
>

This works for me:

Dim thisService as new ServiceController("insert name of this service as it
appears in services list")
thisService.Stop()

Make sure you have any necessary cleanup code in OnStop()...

Regards

--Jim.