windows服务查看 快速进入方式 qt QtService exe 启动服务、卸载服务的命令

按Windows键(像田字的按键)+R键,输入services.msc,回车

 

qt QtService库源码:

https://github.com/qtproject/qt-solutions/tree/master/qtservice

 

 

xxx.exe -i  (xxx.exe -install)安装的一个当前用户帐号的服务。

xxx.exe -s  表示启动了这个Service. 此时,在系统的Service查看窗口按F5刷新,可以看到这个服务的运行状态已经变成Running了。

xxx.exe -p (xxx.exe -pause)暂停这个服务

xxx.exe -r  (xxx.exe -resume)继续这个服务

xxx.exe -t  (xxx.exe -terminate)停止这个服务

xxx.exe -v(xxx.exe -version)

xxx.exe -c (xxx.exe -command )

xxx.exe -h(xxx.exe -help)帮助

xxx.exe -u  (xxx.exe -uninstall)卸载这个服务。

xxx.exe -e选项是如普通程序般运行此exe程序,即不以Service来运行,这是为了Debug方便。

httpservice.exe -e 8082 指定监听端口为8082(默认example中是8080)

注意:查看源码可以知道example中只有使用调试模式,就是-e后面才可以加端口号,当使用服务时不能指定端口,因为使用服务时第二第三参数是分别是account, password,

例如:xxx.exe -i  admin admin  //安装的一个名称为xxx.exe并且用户帐号为admin,密码为admin的服务

 

其实查看源代码是可以看到以上指令的,源码在QtServiceBase::exec中,源码中没有-s这个指令,但经过测试确实存在此指令,以下为源码帮助打印信息。

-[i|u|e|t|p|r|c|v|h]\n"
                   "\t-i(nstall) [account] [password]\t: Install the service, optionally using given account and password\n"
                   "\t-u(ninstall)\t: Uninstall the service.\n"
                   "\t-e(xec)\t\t: Run as a regular application. Useful for debugging.\n"
                   "\t-t(erminate)\t: Stop the service.\n"
                   "\t-p(ause)\t: Pause the service.\n"
                   "\t-r(esume)\t: Resume a paused service.\n"
                   "\t-c(ommand) num\t: Send command code num to the service.\n"
                   "\t-v(ersion)\t: Print version and status information.\n"
                   "\t-h(elp)   \t: Show this help\n"
                   "\tNo arguments\t: Start the service.\n"

 

日志记录好像是在:C:\Windows\System32\LogFiles\HTTPERR目录下,还不是很确定。等待验证

 

参考自:

https://blog.csdn.net/nirendao/article/details/51194003

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值