1:安装服务批处理文件 ,首先新建一个批处理文件:InstallService.bat
方法一:需要把批处理文件跟exe执行文件放在相同的文件夹下 用的是相对路径
%SystemRoot%\Microsoft.NET\Framework\v4.5.30319\InstallUtil.exe -i GTI.BasicData.ActivityService.exe
net start WmsSvr
方法二:绝对路径
installutil.exe E:\XTestDemo\X_15_WindowsService\bin\Debug\GTI.BasicData.ActivityService.exe
方法三:绝对路径
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe "D:\GreenTreeService\ActivityService\GTI.BasicData.ActivityService.exe"
pause
方法四:这里还有一种第三方dll的方式安装,详细请看:
https://blog.youkuaiyun.com/xulong5000/article/details/90235629
2:开启服务:
net start WmsSvr
3:停止服务:
net stop WmsSvr
4:卸载服务:
net stop WmsSvr
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe -u Gysoft.wms.service.exe