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 ...
随机推荐
- php代码在模板页的活用
- LeetCode115 Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S. (Hard) A subse ...
- 中断源记录 INT0 INT1
中断源记录 INT0 INT1 用到一个单片机 使用的 P3.1 P3.3 作为唤醒口,后来发一 P3.1 和 P3.3 使用的同一个中断 INT1,这个尴尬了,只能两选 一. 查看规格书,还好 P3 ...
- C++中用stringstream类进行数据类型的转换
我们在进行C++编程过程中,经常需要进行数据类型的转换. stringstream 类的作用就是进行数据类型转换.要想在程序中使用 stringstream 类,我们需要在源程序文件中包含头文件inc ...
- @atcoder - AGC036D@ Negative Cycle
目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个 N 个点的有向带权图,从 0 编号到 N - 1.一开 ...
- Linux下安装MySQL-python
因为安装过程不断出现错误,备份.系统:linux ubuntupython版本:Python 2.7.3mysql版本:mysql Ver 14.14 Distrib 5.5.35, for deb ...
- 微信小程序之购物车demo
这篇小demo主要使用了一下几个技术点 1.全局变量的使用 在这里定义的变量 任何一个页面和组件都可以访问到 在使用到的页面 const app = getApp(); 声明一个实例 然后 app.g ...
- 当pip安装因为网络超时而无法安装的时候慢
2.4 尝试pip --default-timeout=1000 install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp36-cp ...
- 错误处理——According to TLD or attribute directive in tag file, attribute test does not accept any expres
应用部署运行的时候出现JSP异常, 发生在使用JSTL库的时候: According to TLD or attribute directive in tag file, attribute valu ...
- behavior planning——12.example cost funtion -lane change penalty
In the image above, the blue self driving car (bottom left) is trying to get to the goal (gold sta ...