NSSM: Can't edit a service I created

寵の児 提交于 2019-12-11 06:55:14

问题


I am using NSSM to create a service, however, after creation I need to set some parameters, such as AppDirectory, AppNoConsole, etc.

I am able to create the service using the GUI, but I want to do it via cmd, for which I have a batch file that goes like this:

nssm install MyService "%Java_Exe_Path%" "-Xmx1024M -classpath \bin\start.jar;\lib\*;. com.myapp.class.subclass start"
nssm set MyService AppDirectory "%DIR%"
nssm set MyService AppNoConsole 1

Thing is I am getting errors that read:

Can't open service! OpenService(): Access is denied.

Or

OpenService(): The specified service does not exist as an installed service.

Notes: When I run the cmd file I get asked for admin rights (guessing to run the install), but to edit (set) I am not being requested permissions, neither I get asked permissions if I run the set command directly via commandline (also getting an error of access denied).

Can anyone help? Thanks!

来源:https://stackoverflow.com/questions/50027387/nssm-cant-edit-a-service-i-created

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!