Starts the service, passing no arguments.
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
The following example uses the ServiceController class to check whether the Alerter service is stopped. If the service is stopped, the example starts the service and waits until the service status is set to Running.
for controlling services on the computer. Associated enumeration: ServiceControllerPermissionAccess.Control
for unrestricted access to service information. Associated enumeration: PermissionState.Unrestricted
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)