Imports System.ServiceProcess Public Class Main Shared oWindowsService As WindowsService = Nothing Shared Sub Main() ' If this from the Windows Service If Not Environment.UserInteractive Then Dim loWindowsService As WindowsService = New WindowsService() System.ServiceProcess.ServiceBase.Run(loWindowsService) Else oWindowsService = New WindowsService() oWindowsService.Start() Console.ReadLine() oWindowsService.Stop2() End If End Sub End Class Public Class WindowsService Inherits ServiceBase Public oRobot As Framework.Robot = New Framework.Robot Public oTimer As New System.Timers.Timer(5000) Public Sub New() CanStop = True CanShutdown = True CanPauseAndContinue = False End Sub Protected Overrides Sub OnShutdown() ' TODO: There may be a bug in the .NET Framework in that this method ' is not being called on system shutdown for SYSTEM account services. ' Not sure when/if it will be fixed, but I'm putting code here to stop ' stuff on the off-chance that it will be called eventually. ' stop code here End Sub Protected Overrides Sub OnStart(ByVal toArgs As String()) oRobot.oWindowsService = Me oRobot.Start() ' 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 Sub Start() OnStart(Nothing) End Sub ' 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) oRobot.ServiceTimer() End Sub Public Function Initialize() As Boolean oRobot.cDatabase = "MyDatabase" oRobot.lCloseApplicationOnMaximumLoop = True oApp.cMemberTable = "Member" oApp.cMemberTableFirstName = "Name" oApp.cMemberTableLastAccess = "LastHit" oApp.cMemberTableLastName = "Name" oApp.cTitle = "MyTitle" oApp.lEncryption = True oRobot.AddProcessFile("h:\Software", "RoboCopy.bat") Return True End FunctionSo, the first class is only to be able to instantiate the WindowsService class which inherits from ServiceBase. That one has to inherit from ServiceBase otherwise I would have inherit it from my framework class. So, I really cannot see how the oRobot can inherit automatically from Framework.Robot because it has to be defined in the class which is already inheriting from ServiceBase.