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 ...
随机推荐
- <> 是不等号的意思
<> 是不等号的意思,也有的语言可以写作:# 或者 != 1.=表示 等于: 2.<> 表示不等于:(注释:在 SQL 的一些版本中,该操作符可被写成 !=): 3.> ...
- Date日期类,Canlendar日历类,Math类,Random随机数学类
Date日期类,SimpleDateFormat日期格式类 Date 表示特定的时间,精确到毫秒 常用方法 getTime() setTime() before() after() compareT ...
- 解决:"UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position"错误
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/Haiyang_Duan/article/ ...
- java返回结果集封装
1.返回消息统一定义文件CodeMsg.java public class CodeMsg { private int retCode; private String message; // 按照模块 ...
- 应用中弹出 WiFi 提示框的方法
如果 iOS 程序中用到了 WiFi,想有 WiFi 提示,只需要在 .plist 文件中加入如下 Key/Value 即可: 键名:ApplicationusesWi-Fi 值:YES 键名:SBU ...
- 枚举在switch中的运用
Season.java package com.sxt.utils.enum2; public enum Season { 春,夏,秋,冬; } TestSeason.java package com ...
- UIWebView 真机iOS 8.x系统上报错
crush发生后最终定位到: dyld`dyld_fatal_error: -> >: brk #0x3 控制台打印信息如下: dyld: Symbol not found: _OBJC_ ...
- python 布尔型(bool)
- HZOJ 匹配
Hash/KMP裸题,并不想写什么,只是复习一下KMP吧. void get_n() { next[]=; ; ;i<=lt;i++) { && t[i]!=t[j+])j=ne ...
- CSS中常用的简写模式
一.font属性简写 font-style:字体样式 normal 默认值.浏览器显示一个标准的字体样式. italic 浏览器会显示一个斜体的字体样式. oblique 浏览器会显示一个倾斜的字体样 ...