使用sc.exe命令行工具管理service

2023-01-07  本文已影响0人  CodingCode
  1. query
sc query
  1. start/stop
sc start/stop <servicename>
  1. delete
sc delete <servicename>
  1. 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

上一篇 下一篇

猜你喜欢

热点阅读