1. 安装

  • 新建文本文件,重命名为 ServiceInstall.bat,将 ServiceInstall.bat 的内容替换为:

sc create "Verity Platform Device Service" binPath= "%~dp0WindowsService_HardwareDevice.exe"

sc description "Verity Platform Device Service" "提供设备连接、FMC 电压、PLL 时钟、FPGA 配置、寄存器访问等相关服务"

sc config "Verity Platform Device Service" start= AUTO

sc start "Verity Platform Device Service"

pause

注1:"Verity Platform Device Service" 为服务名;

注2:WindowsService_HardwareDevice.exe 为自己创建的用于承载 WCF 服务的的 Windows服务的安装程序,创建方式如下:

     https://docs.microsoft.com/zh-cn/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-a-managed-windows-service

  注3:pause 的作用为 .bat  运行完不退出,以查看运行结果(也可使用 @cmd.exe)。

  • 管理员身份运行 ServiceInstall.bat 完成 Windows 服务安装。

2. 卸载

  • 新建文本文件,重命名为 ServiceUninstall.bat,将 ServiceUninstall.bat 的内容替换为:

sc stop "Verity Platform Device Service"

sc delete "Verity Platform Device Service" binPath= "%~dp0WindowsService_HardwareDevice.exe"

@cmd.exe

  • 管理员身份运行 ServiceUninstall.bat 完成 Windows 服务卸载。

Windows 服务安装与卸载 (通过 Sc.exe)的更多相关文章

  1. Windows服务安装与卸载

    Windows服务安装与卸载,使用到了InstallUtil.exe 安装: c: cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319&quo ...

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

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

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

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

  4. windows 服务 安装、卸载

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

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

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

  6. windows服务安装,卸载

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

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

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

  8. windows服务安装及卸载

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

  9. windows服务安装卸载

    到C盘下找到对应的开发VS的installutil.exe文件,复制到程序的执行文件(*.exe)相同目录下在开始程序中找到VS命令提示工具 转到程序的执行文件(*.exe)目录下 C:\>cd ...

随机推荐

  1. Add Binary字符数字相加,字符串合成

    Given two binary strings, return their sum (also a binary string). For example,a = "11"b = ...

  2. hdu5289 RMQ+二分

    RMQ预处理最大值,最小值,然后对于每一点,二分可能满足的区间长度,长度-1就是该店开始的区间满足的个数. #include<stdio.h> #include<string.h&g ...

  3. MyBatis映射文件的基本功能

    #{}与${}区别 "#{}"使用的是preparedStatement方式预处理,就是使用了占位符来填充数据防止SQL注入. ${}使用的是statement方式进行sql语句的 ...

  4. F4NNIU 的常用 Linux 命令(2019-08-24)

    目录 F4NNIU 的常用 Linux 命令 停止防火墙 查看 IP 址 启动 deepin 的桌面 查看当前时区 查看 CPU 和内存信息 用户相关 日志 F4NNIU 的常用 Linux 命令 记 ...

  5. 2018-8-10-WPF-轻量级-MVVM-框架入门-2.1.2

    title author date CreateTime categories WPF 轻量级 MVVM 框架入门 2.1.2 lindexi 2018-08-10 19:16:51 +0800 20 ...

  6. @atcoder - AGC034E@ Complete Compress

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个 N 个点的树,编号为 1, 2, ..., N.第 i ...

  7. zip解决杨辉三角问题

    杨辉三角原型: / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ 实现: a = [1] while True: print(a) ...

  8. vue init定制团队模板使用方法

    每次做项目都要自己搭建项目目录,或者换了公司就的重新搭建项目目录,是不是很麻烦呢?有没有想过一次性把项目目录搭建好,以后直接用呢?你首先想到的可能是复制自己原来的项目,然后删除.修改等等.然而有个更方 ...

  9. OracleSpatial函数

    Oracle_spatial的函数 一sdo_Geom包的函数: 用于表示两个几何对象的关系(结果为True/False)的函数:RELATE,WITHIN_DISTANCE 验证的函数:VALIDA ...

  10. H3C 帧中继子接口