M
MW
Hi all,
I want to pass arguments to my OnStart(args) method in a windows service
application.
I tested this out by
NET START myService /test
and it works fine. I however want to give my users the ability to use the
Start button from the Service Control Manager instead of typing NET START or
executing a batch file to the same affect.
To achieve this I thought about editing the registry where the location of
the service exe might be stored. I tried editing the ImagePath property of
the service but that did not work. OnStart did not recieve the arguments.
Incidently thats how Tomcat passes arguments to its service.
I cannot use configuration files or add my own registry settings for this
service and I am restricted to passing the argument. Any comments will be
most welcome.
Many thanks,
-Mujahid
I want to pass arguments to my OnStart(args) method in a windows service
application.
I tested this out by
NET START myService /test
and it works fine. I however want to give my users the ability to use the
Start button from the Service Control Manager instead of typing NET START or
executing a batch file to the same affect.
To achieve this I thought about editing the registry where the location of
the service exe might be stored. I tried editing the ImagePath property of
the service but that did not work. OnStart did not recieve the arguments.
Incidently thats how Tomcat passes arguments to its service.
I cannot use configuration files or add my own registry settings for this
service and I am restricted to passing the argument. Any comments will be
most welcome.
Many thanks,
-Mujahid