如何安装 ,卸载 windows 服务

这里说的是 用脚本做 install, uninstall service.

要安装或者卸载 在.net framework下开发的 windows servcie, 我们需要用到 InstallUtil.exe 。路径在 C:WINDOWSMicrosoft.NETFrameworkv2.0.50727InstallUtil.exe。  当然, 不是让你双击这个exe , 然后敲入下面代码来安装或者卸载。 一般步骤应该是: 启动cmd, 敲入cd 空格 切换到InstallUtil.exe 所在文件夹。

安装:

InstallUtil.exe "c:myservice.exe"

卸载:

InstallUtil /u "c:myservice.exe"

那么, 不用InstallUtil 这个工具, 怎么做 安装或者卸载?

请用sc  命令。

安装:

sc create NewService binpath= c:myservice.exe type= share start= auto depend= "+TDI NetBIOS"

卸载:

sc delete NewService

原文地址:https://www.cnblogs.com/albertjin/p/6962342.html