Windows服务安装与卸载,使用到了InstallUtil.exe

安装:

 c:
cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
InstallUtil.exe "D:\OrderService.exe"

卸载:

 c:
cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
InstallUtil.exe /u "D:\OrderService.exe"

更加高级的,把BAT文件放项目目录下,与.EXE文件平级,无须知道.NET Framework位置

安装:

@echo off
C:
cd C:\Windows\Microsoft.NET\Framework64\v4.*
.\installutil %~dp0OrderService.exe
net start OrderService
pause

Windows服务安装与卸载的更多相关文章

  1. C# windows服务安装及卸载

    --C# windows服务安装及卸载   保存BAT文件  执行即可 @SET FrameworkDir=%WINDIR%\Microsoft.NET\Framework@SET Framework ...

  2. Windows 服务安装与卸载 (通过 Sc.exe)

    1. 安装 新建文本文件,重命名为 ServiceInstall.bat,将 ServiceInstall.bat 的内容替换为: sc create "Verity Platform De ...

  3. Windows 服务安装与卸载 (通过 installutil.exe)

    1. 安装 安装 .NET Framework ; 新建文本文件,重命名为 ServiceInstall.bat,将 ServiceInstall.bat 的内容替换为: C:\\Windows\\M ...

  4. Windows服务安装、卸载、启动和关闭的管理器

    最近在重构公司的系统,把一些需要独立执行.并不需要人为关注的组件转换为Windows服务,Windows服务在使用的过程中有很多好处,相信这一点,就不用我多说了.但是每次都要建立Windows服务项目 ...

  5. windows 服务 安装、卸载

    1.新建项目 选中windows服务 2.添加安装程序 3.修改安装代码 ServiceProcessInstaller processInstall; ServiceInstaller servic ...

  6. windows服务安装,卸载

    首先管理员身份进入cmd cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ 进入C:\Windows\Microsoft.NET\Framewor ...

  7. windows服务安装及卸载

    1)安装脚本Install.bat%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe JobSchedule.exeNet ...

  8. Mongodb的windows服务安装和卸载

    不用 InstallUtil.exe,直接用mongod.exe做就可以: 安装:mongod --dbpath "C:\mongodb\db" --logpath "C ...

  9. Windows服务安装与控制

    Windows服务安装与控制 1.建立服务 (1)定义一个ServiceInstaller using System; using System.Collections.Generic; using ...

随机推荐

  1. 【编程篇】C++11系列之——临时对象分析

    /*C++中返回一个对象时的实现及传说中的右值——临时对象*/ 如下代码: /**********************************************/ class CStuden ...

  2. MSSQL 跨服器调用存储过程

    A库 CREATE PROCEDURE [dbo].[A_P_Test] AS BEGIN SELECT * FROM dbo.A_LoadData END B库  在B中调用A库存储过程 注:是同一 ...

  3. 【PostgreSQL】PostGreSQL数据库,时间数据类型

    ---"17:10:13.236"time without time zone:时:分:秒.毫秒 ---"17:10:13.236+08"time with t ...

  4. Browsersync + Gulp.js

    1.安装 Browsersync 和 依赖包 Gulp npm install browser-sync gulp --save-dev 2.gulpfile.js var gulp = requir ...

  5. scala and machine learning

    http://download.csdn.net/album/detail/3376 scala and machine learning

  6. shell 套用expect

    先用if 判断expect有没有安装 没有就yum install expect #!/bin/bash passwd='123456' /usr/bin/expect <<-EOF se ...

  7. gong server

    宫 server   mac os 系统     vpn 202.39.176.66 funmobigtmvpn  密码 funmobi!@     安装 eclipse 安装mysql   1 配置 ...

  8. Struts2中的ModelDriven机制及其运用

    所谓ModelDriven,意思是直接把实体类当成页面数据的收集对象.比如,有实体类User如下: package cn.com.leadfar.struts2.actions; public cla ...

  9. Moses训练与测试

    参考:http://cache.baiducontent.com/c?m=9d78d513d9991cf00ffa940f47408f711925df252bd6a0502294ca5f92140d1 ...

  10. Join函数 及Split函数精解示例

    '************************************************************************* '**模 块 名:Join函数 及Split函数精 ...