Service parameters

  • Thread starter Thread starter Legrooch
  • Start date Start date
L

Legrooch

I have ready service, that have only a code in OnStart().
Service is working ok.
I have 2 VBScripts which must communicate with service.
How make a communication service-script?

Steps needed (example):
1) script send to service command "start checking system"
2) service run function (build-in) and sending result to script.
3) if system is ok script is going to next step (otherwise scipt is
terminated)
4) script send to service command "check hotfixes"
5) service run function (build-in) and sending result to script.
6) if hotfixes are ok script is going to next step (otherwise scipt is
terminated)
10)..........
11)....


But i need to add a parameters. Script will choose which function want to
start from service and get recieve from him.
Anyone knows how to make this communication?
 
Hi,

Your service could expose part of its functionality through COM interop.
While I've heard it is usually not recommended to use COM in services, you
still can use it. One more note would be that the OnStart method is not the
right place. The service should start as quick as possible and then receive
requests through some channel (be it COM, named pipes, shared memory etc.),
process the requests and return results through the same or other channel.
 
Back
Top