Chilkat VB.NET Service Class Reference

Service

Provides the ability to programmatically install and uninstall Windows Services. Start and stop services. Modify start-properties (auto-start, demand-start, disabled). Query to find out if a service is running or already-installed, etc.

Object Creation

(C#)
Chilkat.Service obj = new Chilkat.Service();
(VB.NET)
Dim obj As New Chilkat.Service()

Properties

AutoStart As Boolean

true if the service should be auto-started when the computer starts, or false if the service should demand-started (not started at system startup time).

DisplayName As String

The display name of the service.

ExeFilename As String

The absolute path + filename of the service's EXE.

LastErrorHtml As String (ReadOnly)

Error information in HTML format for the last method called.

LastErrorText As String (ReadOnly)

Error information in plain-text format for the last method called.

LastErrorXml As String (ReadOnly)

Error information in XML format for the last method called.

ServiceName As String

The name of the service (no SPACE chars allowed, should be alpha-numeric).

Methods

Function Disable() As Boolean

Disables a Windows service.

Returns true for success, false for failure.

Function Install() As Boolean

Installs a Windows service.

Returns true for success, false for failure.

Function IsAutoStart() As Integer

Returns 1 if the service is configured for auto-start, 0 if not, and -1 if it was not possible to check.

Function IsDemandStart() As Integer

Returns 1 if the service is configured for demand-start, 0 if not, and -1 if it was not possible to check.

Function IsDisabled() As Integer

Returns 1 if the service is disabled, 0 if not, and -1 if it was not possible to check.

Function IsInstalled() As Integer

Returns 1 if the service is already installed, 0 if not, and -1 if it was not possible to check.

Function IsRunning() As Integer

Returns 1 if the service is already installed and running, 0 if not, and -1 if it was not possible to check.

Function SaveLastError(ByVal filename As String) As Boolean

Saves the last error information to an XML formatted file.

Function SetAutoStart() As Boolean

Configures an already-installed service for auto-start.

Returns true for success, false for failure.

Function SetDemandStart() As Boolean

Configures an already-installed service for demand-start.

Returns true for success, false for failure.

Function Start() As Boolean

Starts a service.

Returns true for success, false for failure.

Function Stop() As Boolean

Stops a service.

Returns true for success, false for failure.

Function Uninstall() As Boolean

Uninstalls a service.

Returns true for success, false for failure.