转自: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.09.08 poj1185 炮兵阵地(状压dp)

    传送门 状压dp经典题. 我们把每一行的状态压成01串. 预处理出每一行可能出现的状态,然后转移每个被压缩的状态的1的个数就行了. 注意当前行转移要考虑前两行的状态. 还要注意只有一行的情况. 代码: ...

  2. 第一章:模型层model layer

    1.模型和字段 (1)基本的原则如下: 每个模型在Django中的存在形式为一个Python类 每个模型都是django.db.models.Model的子类 模型的每个字段(属性)代表数据表的某一列 ...

  3. HDU 1846 Brave Game (博弈水题)

    题意:中文...你们懂得. 析:这个就是一个水题博弈,就是一个巴什博弈定理,直接就没有变,如果你们看过我写的那个,这个题绝对水过. 附地址:http://www.cnblogs.com/dwtfukg ...

  4. SBIT

    SBIT chmod -R o+t dirs/ 给指定目录设置保护,只有所有者才能删除.

  5. (线段树 区间查询更新) Can you answer these queries? -- hdu--4027

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=4027 分析:因为这个操作是把一个数变成平方根,所以显得略棘手,不过如果仔细演算的话会发现一个2^64数的 ...

  6. listview 异步加载

    http://www.iteye.com/topic/685986 ListView异步加载图片是非常实用的方法,凡是是要通过网络获取图片资源一般使用这种方法比较好,用户体验好,下面就说实现方法,先贴 ...

  7. CF1096D Easy Problem(DP)

    题意:给出一个字符串,去掉第i位的花费为a[i],求使字符串中子串不含hard的最小代价. 题解:这题的思路还是比较套路的,    dp[i][kd]两维,kd=0表示不含d的最小花费,1表示不含rd ...

  8. node 问题

    安装:使用.msi直接安装就好,环境变量已经设置好了 1.问题:验证node是否正确安装 办法:直接计算1+1:创建服务器. 在项目文件夹的路径下,输入node命令,会看到一个提示符,这里只能输入直接 ...

  9. 用C#开发的双色球走势图(原创)值得园友拥有

    首先声明,个人纯粹无聊之作,不作商业用途. 我相信每个人都拥有一个梦想那就是有朝一日能中500W,这个也一直是我的梦想,并默默每一期双色球或多或少要贡献自己一点点力量,本人并不属于那种铁杆的彩票迷,每 ...

  10. asp.net mvc 在JS中跳转到其它controller/action

    平时在ASP.NET 中经常这样写, $('#loginOut').click(function() {           $.messager.confirm('系统提示', '您确定要退出本次登 ...