Start Windows Service from NAV

 

ServiceController := ServiceController.ServiceController;

ServiceController.ServiceName(‘Service Name’);

ServiceController.DisplayName(‘Display Name’);

ServiceController.MachineName(‘Machine Name’);

ServiceController.Start;

ServiceController.WaitForStatus(ServiceController.Status.Running);

ServiceController.Refresh;

MESSAGE(TEXT001);

 

TEXT001 – Service Started

ServiceController –   DOTNET   – 

System.ServiceProcess.ServiceController.’System.ServiceProcess,  Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’