2025-03-14 21:59:59 -06:00
|
|
|
# sc
|
|
|
|
|
|
|
|
|
|
> Communicate with the Service Control Manager and services.
|
|
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/sc-query>.
|
|
|
|
|
|
|
|
|
|
- Show the status of a service (no service name will list all services):
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`sc query {{service_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Start a service asynchronously:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`sc start {{service_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Stop a service asynchronously:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`sc stop {{service_name}}`
|
|
|
|
|
|
|
|
|
|
- Create a service:
|
|
|
|
|
|
|
|
|
|
`sc create {{service_name}} binpath= {{path\to\service_binary_file}}`
|
|
|
|
|
|
|
|
|
|
- Delete a service:
|
|
|
|
|
|
|
|
|
|
`sc delete {{service_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Set the type of a service:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`sc config {{service_name}} type= {{service_type}}`
|