With startup delay programs, you can delay programs and even sometimes Windows Services. In my case I wanted to have a specific Windows Service started after Homeseer was up and running.

With the following script, you can control an exisitng Windows Service (save with .vb extension):

 

Imports System.ServiceProcess

Sub Main(params As Object)

Dim controller As New ServiceController(“traccar”)
‘ Stop the service
controller.Stop()

controller.WaitForStatus(ServiceControllerStatus.Stopped)

‘ Start the service
controller.Start()

End Sub

 

Before this script can actual run via and event, you have to add the library to the Scriping Reference of the Homeseer settings.ini.

  • Shutdown Homeseer
  • Open in the \Config folder the “settings.ini” file
  • Add the following to the existing ScriptReferences: “System.ServiceProcess;System.ServiceProcess.dll”
  • Example: ScriptingReferences=System.ServiceProcess;System.ServiceProcess.dll
  • Save and exit the file.
  • Start Homeseer.

 

Create an Event with Action: Run a script. The script can be downloaded at the bottom of this post.

In the script, the Windows Services name “traccar” is first stopped. Then it wait until it is actually stopped. The final action is to start the service.

It’s up to you to change the settings of the Windows Services itself to start manually.

 

Downloads:

  Service_Traccar.vb (408 bytes, 1,498 hits)