2023-06-30 13:49:06 +01:00
|
|
|
# sc
|
|
|
|
|
|
|
|
> Communicate with the Service Control Manager and services.
|
2023-10-25 17:56:53 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/sc-query>.
|
2023-06-30 13:49:06 +01:00
|
|
|
|
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
|
|
|
|
2023-10-25 17:56:53 +01:00
|
|
|
`sc.exe query {{service_name}}`
|
2023-06-30 13:49:06 +01:00
|
|
|
|
|
|
|
- Start a service asynchronously:
|
|
|
|
|
2023-10-25 17:56:53 +01:00
|
|
|
`sc.exe create {{service_name}} binpath= {{path\to\service_binary_file}}`
|
2023-06-30 13:49:06 +01:00
|
|
|
|
|
|
|
- Stop a service asynchronously:
|
|
|
|
|
2023-10-25 17:56:53 +01:00
|
|
|
`sc.exe delete {{service_name}}`
|
2023-06-30 13:49:06 +01:00
|
|
|
|
|
|
|
- Set the type of a service:
|
|
|
|
|
2023-10-25 17:56:53 +01:00
|
|
|
`sc.exe config {{service_name}} type= {{service_type}}`
|