clsService This class is returned by the
clsServices class (one per service
listed), but you can also use it independently to access a specific system, in the local
machine or through a network. To access a specific service, just set the name or the
display name of the service you want to access. The class will update itself automatically
with the information of the service. Using this class you can also start, stop, pause or
continue services.
(r/w) means read/write property; (r-o) means read-only property. |
:
- AutoUpdate as Boolean (r/w). If this property is
True, when you tell the service to change its state (stop it, start it, pause it...) the
library will start checking for the state of the service till its state changes
completelly or till the time specified in AutoUpdateTimeOut expires. This is because
usually a service doesn't change its state inmediatelly, but needs some time for
processing. Therefore, before when you changed the state of a service, the
CurrentState
property passed to something like [Start Pending], and after that you had to refresh the
state manually. This property is automatically True if you are using this class
independently, and automatically False if you are accessing from a
clsServices class.
- AutoUpdateInterval as Double (r/w). How often the
library will refresh the status of the service, given in milliseconds.
- AutoUpdateTimeOut as Double (r/w). If the service
doesn't change its status, for how long the library should keep refreshing its contents,
in milliseconds.
- BinaryPathName (r/w). Path to the binary file of the
service.
- CheckPoint as Long.
- ComputerName as String (r/w). By default, this
property is empty if you are using this class independently, or has the same value as the
class clsServices is this class is an item of the other. You can specify another name to
access a service in another computer.
- ControlsAccepted as enControlsAccepted (r-o).
Possible values are: [Accept Pause & Continue],
[Accept Shutdown] or
[Accept Stop]. Also, it
could be any combination of these values. To know if a service accepts a certain control,
use an expression like this: CBool (Svc.ControlsAccepted And Accept Stop). If the expression
returns True, then the service accepts the control Stop.
- CurrentState as enServiceStatus (r/w). Possible
values are: [Continue Pending],
[Pause Pending],
Paused, Running,
[Start Pending],
[Stop Pending]
or Stopped. You can also set this property to
Running, Stopped or
Paused to modify the state of
the service.
- Dependencies as clsSVCDependencies (r/w). This
property will return an object that contains the dependecies of the service, if any. You
can also create this class independently and set it to this property to change the
dependencies of the service.
- DisplayName as String (r/w). Display name for the
service (those you can see in the services control manager). If you change this property,
the class will look for another service that has that display name, and if it finds it, it
will update itself with the information of that service.
- LoadOrderGroup as String (r/w).
- Name as String (r/w). Internal name of the service.
You can change this property to the name of other service, and the class will update
itself with the configuration of that service.
- Password as String (r/w). You can use this property
to change the password of the account under which a service is run. If you do it, this
property will also contain that password if the change is successful. If it is not, or you
haven't changed the password, this property will be empty (what doesn't mean that the
account doesn't have any password).
- ServiceSpecificExitCode as Long (r-o).
- ServiceType as enServiceType (r/w). Possible values
are: [File System Driver],
[Kernel Driver],
[WIN32 Own Process],
[WIN32 Share Process],
[Interactive WIN32 Own Process] or
[Interactive WIN32 Share Process].
- StartErrorSeverity as enStartErrorSeverity (r/w).
Possible values are: [Ignore Error],
[Normal Error],
[Severe Error] or [Critical Error]. Informs
on how there server will act if an error ocurres at startup.
- StartName (r/w). Depending on the type of service,
this can be the name of the account under which the service is running.
- StartType as enStartType (r/w). Possible values are:
[Auto Start],
[Boot Start], [Demand Start],
Disabled or [System Start]. Indicates how the service is
started.
- TagID as Long (r/w).
- WaitHint as Long (r-o).
- Win32ExitCode as Long (r-o).
|
:
- ChangeAccount (strUserID As String, strPassword As
String, [strDomain As String]) As Boolean. If you want to change the account under which a
WIN32_OWN_Process service is run, you can't use the
StartName and Password properties
independently, since both must be changed at the same time. Use this method instead.
- ChangeDisplayName (strDisplayName As String) As
Boolean. You can't use the DisplayName property because if you change it, the class will
just look for another service with that display name, instead of changing that property
for the current service. Use this method instead.
- ContinueService as Boolean. Use this method to
continue the service if it is paused. Returns True of successful or
False if an error
ocurred.
- PauseService as Boolean. Use this method to pause a
service if it is running. Returns True of successful or
False if an error ocurred.
- StartService as Boolean. Use this method to start a
service if it is stopped. Returns True of successful or
False if an error ocurred.
- StopService as Boolean. Use this method to stop a
service if it is running. Returns True of successful or
False if an error ocurred.
- Refresh. Forces the library to update the information
about the service. Returns True of successful or
False if an error ocurred.
|