Answer the question
In order to leave comments, you need to log in
How to specify the application config when creating a service?
Good day, I’m trying to create a windows service using the cs.exe utility from .exe, it turns out to create, it starts, but it doesn’t read the configs in which this same .exe is located, I also tried to use nssm for installation, can you tell me where to look?
sc.exe create ServiceName binPath= "C:\dir\app.exe"
sc.exe create ServiceName binPath= "C:\dir\app.exe" "C:\dir"
Answer the question
In order to leave comments, you need to log in
Answer, specify parameter -w
sc.exe create ServiceName binPath="C:\dir\app.exe -w C:\dir"
Service creation .
The "Optionname" and "Optionvalue" parameters are used to specify the names and values of additional options. There is no space between the parameter name and the equals sign. You can specify the name of one or more additional parameters and a pair of values, or not specify them at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question