# Service_SetStartMode

> Sets the start mode for a specified service.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/service-functions/service-setstartmode/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Sets the start mode for a specified service

Valid StartModes are:

- Boot: Device driver started by the operating system loader.
- System: Device driver started by the \*IoInitSystem method. This value is valid only for driver services.
- Automatic: Service to be started automatically by the service control manager during system startup.
- AutomaticDelayed: Service to be started automatically and delayed by the service control manager during system startup.
- Manual: Service to be started by the service control manager when a process calls the \*StartService method.
- Disabled: Service that can no longer be started.

### Syntax

Service_SetStartMode(sServiceName, sStartMode) As Boolean

### Parameters

#### sServiceName (String)

Name of service

#### sStartMode (String)

Start mode. [Service_SetStartMode](/capainstaller/vb-scripting-library/service-functions/service-setstartmode/)

:::note[Important]
AutomaticDelayed

 

When setting startmode of a service to AutomaticDelayed, it may only be shown in the Services Control Panel as Automatic until the computer is restarted. This does not affect the functionality of the startmode and the service will start delayed on next startup.
:::

### Example

**VBScript**

```vb
If bStatus Then bStatus = Service_SetStartMode("Service", SSM_Disabled)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Service_Create](/capainstaller/vb-scripting-library/service-functions/service-create/) [Service_Exist](/capainstaller/vb-scripting-library/service-functions/service-exist/) [Service_Start](/capainstaller/vb-scripting-library/service-functions/service-start/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
