Public oRobot As Framework.Robot = New Framework.Robot Public oTimer As New System.Timers.Timer(5000) Private lStart As Boolean = False Protected Overrides Sub OnStart(ByVal toArgs As String()) ' If we cannot start If Not oRobot.Start() Then lStart = False ' If this from the Console application If Environment.UserInteractive Then Exit Sub Else ' Put 1 second so to have the timer to fire up as soon as the last line in here will be executed ' This is to have the ServiceTimer() event to fire immediately as it is not possible to stop it from here oTimer.Interval = 1000 End If End If ' Define the timer AddHandler oTimer.Elapsed, AddressOf ServiceTimer ' Start the timer oTimer.Enabled = True End Sub Protected Overrides Sub OnStop() End Sub ' This method is only used when not runnning as a Service Public Function Start() As Boolean ' Initialization lStart = True OnStart(Nothing) ' If we were not able to start If Not lStart Then Return False End If Return True End Function ' This method is only used when not runnning as a Service Public Sub Stop2() OnStop() End Sub Private Sub ServiceTimer(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) ' If we did not want the service to start at first If Not lStart Then ' If this from the Windows Service If Not Environment.UserInteractive Then Dim loServiceController As ServiceController = New ServiceController("YourServiceNameHere") loServiceController.Stop() End If End If oRobot.ServiceTimer() End SubIf someone has a better way to do it, feel free to provide feedback.