Windows 服务安装与卸载 (通过 Sc.exe)
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服务的安装程序,创建方式如下:
注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)的更多相关文章
- Windows服务安装与卸载
Windows服务安装与卸载,使用到了InstallUtil.exe 安装: c: cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319&quo ...
- C# windows服务安装及卸载
--C# windows服务安装及卸载 保存BAT文件 执行即可 @SET FrameworkDir=%WINDIR%\Microsoft.NET\Framework@SET Framework ...
- Windows 服务安装与卸载 (通过 installutil.exe)
1. 安装 安装 .NET Framework ; 新建文本文件,重命名为 ServiceInstall.bat,将 ServiceInstall.bat 的内容替换为: C:\\Windows\\M ...
- windows 服务 安装、卸载
1.新建项目 选中windows服务 2.添加安装程序 3.修改安装代码 ServiceProcessInstaller processInstall; ServiceInstaller servic ...
- Windows服务安装、卸载、启动和关闭的管理器
最近在重构公司的系统,把一些需要独立执行.并不需要人为关注的组件转换为Windows服务,Windows服务在使用的过程中有很多好处,相信这一点,就不用我多说了.但是每次都要建立Windows服务项目 ...
- windows服务安装,卸载
首先管理员身份进入cmd cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ 进入C:\Windows\Microsoft.NET\Framewor ...
- Mongodb的windows服务安装和卸载
不用 InstallUtil.exe,直接用mongod.exe做就可以: 安装:mongod --dbpath "C:\mongodb\db" --logpath "C ...
- windows服务安装及卸载
1)安装脚本Install.bat%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe JobSchedule.exeNet ...
- windows服务安装卸载
到C盘下找到对应的开发VS的installutil.exe文件,复制到程序的执行文件(*.exe)相同目录下在开始程序中找到VS命令提示工具 转到程序的执行文件(*.exe)目录下 C:\>cd ...
随机推荐
- List容器-ArrayList
特点: 有序重复,包括null,通过整数索引访问 实现类ArrayList和LinkedList ArrayList--动态数组 不线程同步 单线程合适 List<String> ...
- Flask 第二篇
Flask 中的 Render Redirect HttpResponse 1.Flask中的HTTPResponse 在Flask 中的HttpResponse 在我们看来其实就是直接返回字符串 2 ...
- Java练习 SDUT-4303_简单的复数运算(类和对象)
简单的复数运算(类和对象) Time Limit: 2000 ms Memory Limit: 65536 KiB Problem Description 设计一个类Complex,用于封装对复数的下 ...
- thinkphp 公用函数
thinkphp 的项目中指定了common/function.php的函数是公用函数. 不但php页面可以使用,模板文件也可以使用:
- nodeJs学习-02 fs模块(文件操作)
读文件: const fs = require('fs'); //读文件(异步) readFile(文件名,回调函数) fs.readFile('section03/testData/aaa.txt' ...
- SP2-0642: SQL*Plus internal error state 2130, context 0:0:0
..experience, Working case SP2-0642: SQL*Plus internal error state 2130, context 0:0:0 2016-10-09 没有 ...
- 三级分销会员一次查询出来的SQL语句
SELECT p.id AS partyId, p.parent_id AS parentId, pul.username AS userName, p.city, p.birth_date AS b ...
- 转载:ubuntu 下的dpkg 的用法
dpkg是一个Debian的一个命令行工具,它可以用来安装.删除.构建和管理Debian的软件包. 下面是它的一些命令解释: 1)安装软件 命令行:dpkg -i <.deb file name ...
- 模板—扩展GCD*2
有必要重新学一下扩展GCD emmmm. 主要是扩展GCD求解线性同余方程$ax≡b (mod p)$. 1.方程有解的充分必要条件:b%gcd(a,p)=0. 证明: $ax-py=b$ 由于求解整 ...
- 22-1 rbac权限设计
一 表结构设计 from django.db import models # Create your models here. from django.db import models # Creat ...