使用TopShelf做windows服务安装 ---安装参数解释

转自: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

-usernameThe username to run the service
-passwordThe password for the specified username
-instanceAn instance name if registering the service multiple times
--autostartThe service should start automatically (default)
--disabledThe service should be set to disabled
--manualThe service should be started manually
--delayedThe service should start automatically (delayed)
--localsystemRun the service with the local system account
--localserviceRun the service with the local service account
--networkservice
 Run the service with the network service permission
--interactiveThe service will prompt the user at installation for the service credentials
--sudoPrompts for UAC if running on Vista/W7/2008
-servicenameThe name that the service should use when installing
-descriptionThe service description the service should use when installing. Eg: -description: MyService Eg: -description “My Service”
-displaynameThe 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

-instanceThe instance to start

stop Stops the service if it is running

-instanceThe instance to stop

uninstall Uninstalls the service

-instanceAn instance name if registering the service multiple times
--sudoPrompts 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

转载于:https://www.cnblogs.com/liyangLife/p/7248759.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值