创建一个服务

New-Service -Name testService -Description "This is a test service" -BinaryPathName "C:Windowssystem32svchost.exe -k netsvcs -p" -DisplayName ExecutNote -StartupType Automatic

  

执行删除/启动:  sc delete testService / sc start testService

原文地址:https://www.cnblogs.com/feiyucha/p/10633424.html