服务创建&删除

时间:2021-09-27 17:12:30

创建服务.bat

@echo.服务启动......
@echo off
@sc create BestoneProductEditSvc binPath= "D:\winSvc\BestoneProductEditSvc\BestoneProductEditSvc.exe"
@net start BestoneProductEditSvc
@sc config BestoneProductEditSvc start= AUTO
@echo off
@echo.启动完毕!
@pause

删除服务.bat

@echo.服务删除
@echo off
@sc delete BestoneProductEditSvc
@echo off
@echo.删除结束!
@pause
BestoneProductEditSvc:服务名
binPath:程序目录