I have a windows service application that i can install using sc.exe from command line. I'm trying to create another (manager) service that will check if i have a certain number of instances of the (worker) service running. If not the manager will install the the application how many ever times required with a unique name each time (lets say add random number for now)
I've tried the following
in the manager service have the following:
http://dotnetstep.blogspot.com/2009/06/programmatically-install-window-service.html
but i keep getting
"Cannot open Service Control Manager on computer '.'. This operation might require other privileges."
i tried
Installing Windows Service programmatically
but i need to pass in parameters to the worker executable, as well as specify unique servicename and displayname
Not sure what i'm missing here
Thanks