ChilkatService ActiveX Reference
ChilkatService
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
(Visual Basic 6.0)
Dim obj As New ChilkatService
(ASP)
set obj = Server.CreateObject("Chilkat.Service")
(VBScript)
set obj = CreateObject("Chilkat.Service")
(Delphi)
obj := TChilkatService.Create(Self);
(FoxPro)
loObject = CreateObject('Chilkat.Service')
(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat.Service', @obj OUT
(Javascript)
var obj = new ActiveXObject("Chilkat.Service");
Properties
AutoStart As Long
1 if the service should be auto-started when the computer starts, or 0 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 (read-only)
Error information in HTML format for the last method called.
LastErrorText As String (read-only)
Error information in plain-text format for the last method called.
LastErrorXml As String (read-only)
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
Disable() As Long
Disables a Windows service. Returns 1 for success, 0 for failure.
Install() As Long
Installs a Windows service. Returns 1 for success, 0 for failure.
IsAutoStart() As Long
Returns 1 if the service is configured for auto-start, 0 if not, and -1 if it was not possible to check.
IsDemandStart() As Long
Returns 1 if the service is configured for demand-start, 0 if not, and -1 if it was not possible to check.
IsDisabled() As Long
Returns 1 if the service is disabled, 0 if not, and -1 if it was not possible to check.
IsInstalled() As Long
Returns 1 if the service is already installed, 0 if not, and -1 if it was not possible to check.
IsRunning() As Long
Returns 1 if the service is already installed and running, 0 if not, and -1 if it was not possible to check.
SaveLastError(logFilename As String) As Long
Saves the last error information to an XML formatted file.
SetAutoStart() As Long
Configures an already-installed service for auto-start. Returns 1 for success, 0 for failure.
SetDemandStart() As Long
Configures an already-installed service for demand-start. Returns 1 for success, 0 for failure.
Start() As Long
Starts a service. Returns 1 for success, 0 for failure.
Stop() As Long
Stops a service. Returns 1 for success, 0 for failure.
Uninstall() As Long
Uninstalls a service. Returns 1 for success, 0 for failure.
|