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. 整合Freemarker视图层和整合jsp视图层和全局捕获异常

    SpringBoot静态资源访问 1.静态资源:访问 js / css /图片,传统web工程,webapps springboot 要求:静态资源存放在resource目录下(可以自定义文件存放) ...

  2. poj 2431 【优先队列】

    poj 2431 Description A group of cows grabbed a truck and ventured on an expedition deep into the jun ...

  3. 使用 UIWebView 来播放视频

    MPMoviePlayerController 并不是继承自 UIViewController SDK 中的例子使用的是 addSubviews 的方式来添加 MPMoviePlayerControl ...

  4. navicat for mysql 在Mac上安装后没有连接列表,就是左边的那一列连接项目怎么办?

    在连接数处打对勾就可以了

  5. 利用idea构建hibernate

    1.创建项目 若勾选Use library,则点击右侧的Create,使用本地已下载的Hibernate 5.2.13框架(必须导入hibernate-release-5.2.13.Final\lib ...

  6. 括号序列问题 uva 1626 poj 1141【区间dp】

    首先考虑下面的问题:Code[VS] 3657 我们用以下规则定义一个合法的括号序列: (1)空序列是合法的 (2)假如S是一个合法的序列,则 (S) 和[S]都是合法的 (3)假如A 和 B 都是合 ...

  7. rank(),允许并列名次、复制名次自动空缺,结果如12245558……

    将score按ID分组排名:rank() over(partition by id order by score desc) 将score不分组排名:rank() over(order by scor ...

  8. 模板—LCT

    #include<iostream> #include<cstring> #include<cstdio> #define LL long long using n ...

  9. SQL注入原理讲解,很不错!

    SQL注入原理讲解,很不错! 原文地址:http://www.cnblogs.com/rush/archive/2011/12/31/2309203.html 1.1.1 摘要 日前,国内最大的程序员 ...

  10. day5-python之面向过程编程

    一.面向过程编程 #1.首先强调:面向过程编程绝对不是用函数编程这么简单,面向过程是一种编程思路.思想,而编程思路是不依赖于具体的语言或语法的.言外之意是即使我们不依赖于函数,也可以基于面向过程的思想 ...