Property Name
StartType
Property Type
enumStartTypes
Description
Gets and sets the values that indicates how (or when) the service
starts. It also indicates the actions to be taken if the service
startup fails.
The following service start values are supported:
Start Type Value |
Description |
STARTTYPE_BOOT_START = 0 |
Specifies the device driver started when the system boots up. This value is valid only for driver services |
STARTTYPE_SYSTEM_START = 1 |
Specifies a device driver started by the system initialization function. This value is valid only for driver services |
STARTTYPE_AUTO_START = 2 |
Specifies a service to be started automatically by the service control manager during system startup |
STARTTYPE_DEMAND_START = 3 |
Specifies a service to be started by the service control manager when a process calls the StartService function |
STARTTYPE_DISABLED = 4 |
Specifies a service that can no longer be started |
If the Service fails, the following values are supported:
Values |
Description |
SvcActionNone = 0 |
No Action taken on service startup failure |
SvcActionRebootComputer = 1 |
Reboot the computer on service startup failure |
SvcActionRestartService = 2 |
Restart the service on service startup failure |
SvcActionRunCommand = 3 |
Run a specified command on service startup failure |
Example
Dim serobj As IADsService
'Get the object of the service
Set serobj = GetObject("NTDS://MSFT/MOON/Messenger")
'Get the service start type property of the service
Debug.Print serobj.StartType
'set the service start type property to Automatic
serobj.StartType = STARTTYPE_AUTO_START
serobj.SetInfo
See Also: