I try to install a Windows Service having parameters.
I try to reproduce something like this:
but it seem impossible to install it like this :
InstallUtil.exe "C:\MyPath..\MyExe.ProcessorService.exe -service myParam"
I try to install a Windows Service having parameters.
I try to reproduce something like this:
but it seem impossible to install it like this :
InstallUtil.exe "C:\MyPath..\MyExe.ProcessorService.exe -service myParam"
Copyright © 2021 Jogjafile Inc.

From what I can tell,
InstallUtil.exedoes not support this. It doesn't appear to have command line switches for adding parameters to the service start command.It does appear you can do this via the
sc startcommand from this answer. Thenet startcommand might even allow you to do it, too, based on this answer.Fundamentally, if you have a service named
Foo, the registry key of interest isImagePath:If you following the instructions here to have your service install itself from the command line (e.g.,
<PathToService>\MyService.exe -install), you should be able add the necessary logic after theInstallService()call to have the service update itsImagePathregistry key with the necessary parameters.HTH