zoukankan      html  css  js  c++  java
  • 使用winsw给Win10添加服务

    平台:win10

    问题:把自启动程序添加为服务

    解决过程:

    一直习惯了用CLaunch启动各类应用程序,但近期不知怎么回事,每次进入系统CLaunch都不会自动启动。重装后也好用没几天。明明计划任务里CLaunch的启动设置很正常的。

    于是干脆把ClAdmin.exe设置成服务好了。

    使用WinSW的过程如下。

    1、去https://github.com/kohsuke/winsw/releases下载WinSW的主程序WinSW.NET4.exe和配置文件sample-minimal.xml

    2、把WinSW.NET4.exesample-minimal.xml拷贝到CLaunch的安装路径D:Program FilesCLaunch下。给WinSW.NET4.exe改名为CLauncher.exe,sample-minimal.xml改名为CLauncher.xml。

    3、用Notepad++(或者notepad2)打开CLauncher.xml,进行部分设置如下

    <service>

    <!-- ID of the service. It should be unique across the Windows system-->
    <id>CLaunch</id>
    <!-- Display name of the service -->
    <name>CLaunch</name>
    <!-- Service description -->
    <description>CLaunch是个用于增强桌面功能的快速启动软件,本服务由Windows Service Wrapper(WinSW)建立。</description>

    <!-- Path to the executable, which should be started -->
    <executable>D:Program FilesCLaunchClAdmin.exe</executable>

    </service>

    4、用管理员权限打开CMD,定位到D:Program FilesCLaunch下,输入CLauncher.exe install,回车,提示“Installing the service with id 'CLaunch'”服务安装成功。运行services.msc打开服务管理窗口,找到CLaunch服务,跟普通服务一样可以设置自动、手动、禁用,启用停用,发现可执行路径为"D:Program FilesCLaunchCLauncher.exe"。显然CLaunch.exe的启动是由WinSW中转了下。

    5、想卸载该服务,可以重复4步骤,输入CLauncher.exe uninstall

  • 相关阅读:
    bootStrap-treeview插件
    UML常用图的几种关系的总结
    RFC中文文档
    继承:重新使用接口
    Java8向后兼容
    Java8 时间调节器
    Java8 ChronoUnits枚举
    BigDecimal.divide方法
    java.lang.Double.byteValue() 方法
    事件处理是什么?
  • 原文地址:https://www.cnblogs.com/mahocon/p/12355695.html
Copyright © 2011-2022 走看看