CkService Java Programming Reference Documentation
CkService
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
CkService obj = new CkService();
Properties
// Returns a boolean value get_AutoStart( )
// newVal is a boolean (input) put_AutoStart( newVal )
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).
// str is a CkString object (output) get_DisplayName( str )
// newVal is a string (input) put_DisplayName( newVal )
The display name of the service.
// str is a CkString object (output) get_ExeFilename( str )
// newVal is a string (input) put_ExeFilename( newVal )
The absolute path + filename of the service's EXE.
// str is a CkString object (output) LastErrorHtml( str )
Error information in HTML format for the last method called.
// str is a CkString object (output) LastErrorText( str )
Error information in plain-text format for the last method called.
// str is a CkString object (output) LastErrorXml( str )
Error information in XML format for the last method called.
// str is a CkString object (output) get_ServiceName( str )
// newVal is a string (input) put_ServiceName( newVal )
The name of the service (no SPACE chars allowed, should be alpha-numeric).
Methods
// Returns a boolean value Disable( )
Disables a Windows service. Returns true for success, false for failure.
// Returns a boolean value Install( )
Installs a Windows service. Returns true for success, false for failure.
// Returns an integer value IsAutoStart( )
Returns 1 if the service is configured for auto-start, 0 if not, and -1 if it was not possible to check.
// Returns an integer value IsDemandStart( )
Returns 1 if the service is configured for demand-start, 0 if not, and -1 if it was not possible to check.
// Returns an integer value IsDisabled( )
Returns 1 if the service is disabled, 0 if not, and -1 if it was not possible to check.
// Returns an integer value IsInstalled( )
Returns 1 if the service is already installed, 0 if not, and -1 if it was not possible to check.
// Returns an integer value IsRunning( )
Returns 1 if the service is already installed and running, 0 if not, and -1 if it was not possible to check.
// filename is a string (input) // Returns a boolean value SaveLastError( filename )
Saves the last error information to an XML formatted file.
// Returns a boolean value SetAutoStart( )
Configures an already-installed service for auto-start. Returns true for success, false for failure.
// Returns a boolean value SetDemandStart( )
Configures an already-installed service for demand-start. Returns true for success, false for failure.
// Returns a boolean value Start( )
Starts a service. Returns true for success, false for failure.
// Returns a boolean value Stop( )
Stops a service. Returns true for success, false for failure.
// Returns a boolean value Uninstall( )
Uninstalls a service. Returns true for success, false for failure.
// Returns a string displayName( )
The display name of the service.
// Returns a string exeFilename( )
The absolute path + filename of the service's EXE.
// Returns a string lastErrorHtml( )
Error information in HTML format for the last method called.
// Returns a string lastErrorText( )
Error information in plain-text format for the last method called.
// Returns a string lastErrorXml( )
Error information in XML format for the last method called.
// Returns a string serviceName( )
The name of the service (no SPACE chars allowed, should be alpha-numeric).
|