O
O
Oleg Aksenov2019-02-22 10:49:50
Windows
Oleg Aksenov, 2019-02-22 10:49:50

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"

Tried more variations
sc.exe create ServiceName binPath= "C:\dir\app.exe" "C:\dir"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Aksenov, 2019-02-22
@Takun

Answer, specify parameter -w
sc.exe create ServiceName binPath="C:\dir\app.exe -w C:\dir"

K
Konstantin Tsvetkov, 2019-02-22
@tsklab

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 question

Ask a Question

731 491 924 answers to any question