Windows服务BAT命令-安装、卸载、启动、停止

1、安装服务

%SystemRoot%Microsoft.NETFrameworkv4.0.30319installutil.exe D:WiseMESMES.WindowsService.exe
Net Start AOIService
sc config AOIService start= auto
pause

2、卸载服务

%SystemRoot%Microsoft.NETFrameworkv4.0.30319installutil.exe /u D:WiseMESMES.WindowsService.exe
pause

3、命令参数说明

复制代码
net start 服务名  //启动服务
net stop 服务名  //停止服务

用sc可打开被禁用的服务,语法是:【Start=号后面有空格】 
sc config 服务名 start= demand //手动 
sc config 服务名 start= auto //自动 
sc config 服务名 start= disabled //禁用 
sc start 服务名 
sc stop 服务名
原文地址:https://www.cnblogs.com/liqing1009/p/10251679.html