转自:https://topshelf.readthedocs.io/en/latest/overview/commandline.html

Topshelf Command-Line Reference

Once a service has been created using Topshelf, an extensive command-line vocabulary is available which can be used to install, uninstall, start, and configure the service.

The command-line help can be displayed at any time by entering myService.exe help on the command-line.

Help Text

The help text from the command line is shown below for easy reference.

service.exe [verb] [-option:value] [-switch]

run Runs the service from the command line (default)

help or –help Displays help

install Installs the service

-username The username to run the service
-password The password for the specified username
-instance An instance name if registering the service multiple times
--autostart The service should start automatically (default)
--disabled The service should be set to disabled
--manual The service should be started manually
--delayed The service should start automatically (delayed)
--localsystem Run the service with the local system account
--localservice Run the service with the local service account
--networkservice
  Run the service with the network service permission
--interactive The service will prompt the user at installation for the service credentials
--sudo Prompts for UAC if running on Vista/W7/2008
-servicename The name that the service should use when installing
-description The service description the service should use when installing. Eg: -description: MyService Eg: -description “My Service”
-displayname The display name the the service should use when installing Eg: -displayname: MyService Eg: -displayname “My Service”

start Starts the service if it is not already running

-instance The instance to start

stop Stops the service if it is running

-instance The instance to stop

uninstall Uninstalls the service

-instance An instance name if registering the service multiple times
--sudo Prompts for UAC if running on Vista/W7/2008

Examples

Basic Service Installation

MyService.exe install -username:DOMAINServiceAccount -password:itsASecret -servicename:AwesomeService –autostart

Service Installation with Quoted Arguments

MyService.exe install -username “DOMAINService Account” -password:”Its A Secret” -servicename “Awesome Service” –autostart

使用TopShelf做windows服务安装 ---安装参数解释的更多相关文章

  1. 使用TopShelf做windows服务

    class Program { static void Main(string[] args) { HostFactory.Run(x => { x.RunAsLocalSystem(); x. ...

  2. 为C# Windows服务添加安装程序

    最近一直在搞Windows服务,也有了不少经验,感觉权限方面确定比一般程序要受限很多,但方便性也很多.像后台运行不阻塞系统,不用用户登录之类.哈哈,扯远了,今天讲一下那个怎么给Windows服务做个安 ...

  3. (转)为C# Windows服务添加安装程序

    本文转载自:http://kamiff.iteye.com/blog/507129 最近一直在搞Windows服务,也有了不少经验,感觉权限方面确定比一般程序要受限很多,但方便性也很多.像后台运行不阻 ...

  4. 使用InstallUtil对Windows服务进行安装与卸载

    关于Visual Studio 2012中使用InstallUtil对Windows服务进行安装与卸载的文章,在MSDN中的http://msdn.microsoft.com/en-us/librar ...

  5. C# VS2010 windows服务的安装

    可能是太过于懒惰的原因,研究个windows 服务的安装程序都花了大半天时间.在网上看了一些示例,大部分都言过其实,把过程搞得太过复杂,老是需要去研究如何利用InstallUtil.exe及其参数.事 ...

  6. Windows服务的安装卸载及错误查找

    @echo off echo 清理原有服务项. . . %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil /U D:\abc\te ...

  7. C#操作windows服务,安装、卸载、停止、启动

    public class ServiceUtil { private string _ServiceName = string.Empty; private string _AppName = str ...

  8. 制作Windows服务和安装程序(C#版)

    http://blog.sina.com.cn/s/blog_5f4ffa170100vt2b.html 1.创建服务项目: 打开VS 2005 编程环境,在C#中新建Windows服务程序 2.将安 ...

  9. 使用Topshelf创建Windows服务

    概述 Topshelf是创建Windows服务的另一种方法,老外的一篇文章Create a .NET Windows Service in 5 steps with Topshelf通过5个步骤详细的 ...

随机推荐

  1. 2018.07.23[PA2015]Siano(线段树)

    [PA2015]Siano 描述 Description 农夫Byteasar买了一片n亩的土地,他要在这上面种草. 他在每一亩土地上都种植了一种独一无二的草,其中,第i亩土地的草每天会长高a[i]厘 ...

  2. hdu-1698(线段树,区间修改)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 注意:用位运算会更快,不然超时. #include<iostream> #inclu ...

  3. 201709015工作日记--上下文的理解,ASM

    1.Android上下文理解 Android上下文对象,在Context中封装一个所谓的“语境”,Activity.Service.Application都继承自Context,所以在这三者创建时都会 ...

  4. tensorflow1.12 cuda10 cudnn7

    https://download.csdn.net/download/giselite/10909984 https://blog.csdn.net/chary8088/article/details ...

  5. OpenGL + MFC

    OpenGL超级宝典(中文版) 2001年 本书是一本完整而详尽的关于OpenGL的参考书,全书分为四部分:第一部分“OpenGL导言”介绍3D图形学的基本原理,读者将在此学会构造使用OpenGL的程 ...

  6. github/gitlab添加多个ssh key

    系统:macOS X 由于公司的代码管理放在了gitlab.com上,所以添加了一个ssh key, 生成ssh key的代码如下: 1.$ ssh-keygen -t rsa -C “yourema ...

  7. android build.gradle(groovy)

    一.build.Gradle 这个 build.Gradle 文件来自 drakeet 大神的 Meizi 项目我直接在代码上加注释,参照着注释看代码就行,是不是发现有很多代码平时都没看见过. //M ...

  8. 绩效沟通的best原则

    绩效沟通-BEST原则 BEST原则指在进行绩效/IDP面谈的时候按照以下步骤进行: 案例:小赵经常在制作标书时候犯错误 Behavior description 描述行为 小赵,8月6日,你制作的标 ...

  9. hdu 5014 异或序列

    http://acm.hdu.edu.cn/showproblem.php?pid=5014 从最大的一个数开始找能配对使他们的异或值最大的一个数 最后输出 #include <cstdio&g ...

  10. poj2462

    看八戒在做这个题,我也做了做.. 坑很多,还是要注意细节.不得不吐槽,难道又到了计算几何只能套模板否则就一串WA的情况了么! 要不是八戒做出来了,这题我估计我也就扔到这里了..哥不服啊~所以得做出来! ...