XXXXX
C/C++
XXXXX
C#/.net
XXXXX
js
java
java
开发导航 开发导航 www.endv.cn
天云

使用InstallUtil对Windows服务进行安装与卸载

关于Visual Studio 2012中使用InstallUtil对Windows服务进行安装与卸载的文章,在MSDN中的http://msdn.microsoft.com/en-us/library/sd8zc8ha.aspx 有介绍  :

  1. 点击左下角的开始按钮,按如下顺序“开始 - Visual Studio 2012 - Visual Studio Tools - Developer Command Prompt  for VS2012”,打开一个命令窗口 
  2.   runas /user:Administrator cmd   
  3.  提示输入该用户名的密码,按要求输入( 输入的密码无任何显示)
  4. 密码输入正确后,新开一个cmd窗口,标题是cmd(作为Myname运行)
  5.  输入命令: installutil.exe Myservice.exe 如果安装成功,则直接显示命令提示符,没有任何信息;如果安装不成功,则会有信息出现 
  6.  管理 -  服务 ,可以找到服务“Myservice” 点击启动 

 

C:\windows\system32>runas /user:cn-hr@outlook.com cmd
输入 cn-hr@outlook.com 的密码:
试图将 cmd 作为用户 "cn-hr@outlook.com" 启动...

 

2、InstallUtil.exe可以单独运行, 

卸载Windows服务,使用/u参数即可。命令为:

installutil /u Myservice.exe

 

 1  runas /user:cn-hr@outlook.com cmd
 2 
 3 C:\Windows\WinSxS\amd64_installutil_b03f5f7f11d50a3a_6.3.9600.20708_none_3801968eea5f295e\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
 4 
 5 
 6 
 7 C:\Windows\WinSxS\x86_installutil_b03f5f7f11d50a3a_6.3.9600.16384_none_9684d201e52c559f\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
 8 
 9  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
10 
11 
12 "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
13 
14 "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
15 
16 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe D:\Development\IM\LanMsg4public\LanMsgService\bin\LanMsgService.exe
17 
18 C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe D:\Development\IM\OurMsg2.3.5.6\Server\Bin\OurMsgService.exe"
19 
20 
21 
22 C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe D:\Development\IM\OurMsg2.3.5.6\Server\Bin\OurMsgServer.exe"

 

posted @ 2015-07-06 04:58  Endv  阅读(1459)  评论(0编辑  收藏  举报