windows 服务的安装和卸载

方式(一)

1 创建windows 服务。 

2 在文件 “Service1.cs” 设计视图,右击“添加安装程序”,设置相关属性

3 运行 cmd ,

   1) cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

    找到 installutil.exe 所在位置  ,本机:“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727”

  2) installutil ‘路径\windows 服务.exe‘ 

          执行安装 

  3) installutil /u ‘路径\windows 服务.exe‘ 

         执行卸载

方式(二)

 步骤1,2同上。

 3 将 installutil.exe 实用程序 与 服务安装文件放到同一目录下, 制作两个批处理文件 内容分别为 “InstallUtil.exe PracticeWinService.exe” (安装),

  “InstallUtil.exe PracticeWinService.exe /u”(卸载s)。

 

posted @ 2010-05-07 15:07  Yan Wj  阅读(202)  评论(0编辑  收藏  举报