很多东西都写过做过,就是不知道是什么, 这就是程序员和搬运工的区别吧

如何安装 ,卸载 windows 服务

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

要安装或者卸载 在.net framework下开发的 windows servcie, 我们需要用到 InstallUtil.exe 。路径在 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.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

posted @ 2017-06-08 13:36  三五千大牛  阅读(229)  评论(0编辑  收藏  举报