2023-06-30 05:49:06 -07:00
|
|
|
# sc
|
|
|
|
|
|
|
|
> Communicate with the Service Control Manager and services.
|
2023-10-25 13:56:53 -03:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/sc-query>.
|
2023-06-30 05:49:06 -07:00
|
|
|
|
2023-07-18 19:42:42 -07:00
|
|
|
- Show the status of a service (no service name will list all services):
|
2023-06-30 05:49:06 -07:00
|
|
|
|
2023-10-25 13:56:53 -03:00
|
|
|
`sc.exe query {{service_name}}`
|
2023-06-30 05:49:06 -07:00
|
|
|
|
|
|
|
- Start a service asynchronously:
|
|
|
|
|
2023-10-25 13:56:53 -03:00
|
|
|
`sc.exe create {{service_name}} binpath= {{path\to\service_binary_file}}`
|
2023-06-30 05:49:06 -07:00
|
|
|
|
|
|
|
- Stop a service asynchronously:
|
|
|
|
|
2023-10-25 13:56:53 -03:00
|
|
|
`sc.exe delete {{service_name}}`
|
2023-06-30 05:49:06 -07:00
|
|
|
|
|
|
|
- Set the type of a service:
|
|
|
|
|
2023-10-25 13:56:53 -03:00
|
|
|
`sc.exe config {{service_name}} type= {{service_type}}`
|