2023-06-30 13:49:06 +01:00
|
|
|
# sc
|
|
|
|
|
|
|
|
> Communicate with the Service Control Manager and services.
|
|
|
|
> More information: <https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query>.
|
|
|
|
|
2023-07-19 03:42:42 +01:00
|
|
|
- Show the status of a service (no service name will list all services):
|
2023-06-30 13:49:06 +01:00
|
|
|
|
|
|
|
`sc queryex {{service_name}}`
|
|
|
|
|
|
|
|
- Start a service asynchronously:
|
|
|
|
|
|
|
|
`sc start {{service_name}}`
|
|
|
|
|
|
|
|
- Stop a service asynchronously:
|
|
|
|
|
|
|
|
`sc stop {{service_name}}`
|
|
|
|
|
|
|
|
- Set the type of a service:
|
|
|
|
|
|
|
|
`sc config {{service_name}} type= {{service_type}}`
|