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

  • 相关阅读:
    POJ 1401 Factorial
    POJ 2407 Relatives(欧拉函数)
    POJ 1730 Perfect Pth Powers(唯一分解定理)
    POJ 2262 Goldbach's Conjecture(Eratosthenes筛法)
    POJ 2551 Ones
    POJ 1163 The Triangle
    POJ 3356 AGTC
    POJ 2192 Zipper
    POJ 1080 Human Gene Functions
    POJ 1159 Palindrome(最长公共子序列)
  • 原文地址:https://www.cnblogs.com/mahocon/p/12355695.html
Copyright © 2011-2022 走看看