- query
sc query
- start/stop
sc start/stop <servicename>
- delete
sc delete <servicename>
- install
sc create <servicename> binPath=<binpath> type=<type> start=<start>
例如:
sc create myservice binpath=c:\test\myservice\myservice.exe type=own start=auto
关于命令行的详细参数请查阅:https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create
所有service的信息都被记录注册表中HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
。
网友评论