Hi,
I made a simple service with a ServiceProcessInstaller and ServiceInstaller Classes. The service installs and runs well. I would just like to know where to set the start parameters for my service. Is there a property for that? I can't find it in either classes.
Properties for servicename, description,startuptype,etc. exist, but can't find one for startparameters.
Thanks in advance.
Regards,
Jan
Loading
Jan MontanoPosted Dec 29, 2008, 11:31 PM
fyi. it could be set via registry. I just can't remember the exact key, but it could be set via registry that's for sure. I just don't have the code here with me. But will find it as soon as possible.
Posted Dec 14, 2007, 10:59 AM
Anyway, I dont know much of anything about services so Im gonna take a shot in the dark but perhaps you could try using some preprocessor directives to implement certain parameters into the application before it technically starts. Or perhaps modify the program.cs file?
If you find out anything, let us know as Im interested too : )
Jan MontanoPosted Dec 14, 2007, 2:52 AM
Or is there a registry entry where I could set the service's start parameters?
And why can't I manually change the start parameters of any services in the services.msc? When I click ok and check the properties of the service again, the start parameters reverts back to a blank value. why? and the path to executable doesn't have an appended start parameters which I just entered...
THanks.
Jan MontanoPosted Nov 20, 2007, 9:17 PM
Alan, I thought so. huhuhu :=( I was avoiding setting the parameters in the services UI. And I find it odd not having a property for the start parameters in the installer classes when you could add start parameters in the services UI. Thanks!
wahh!!! (^_^) Thanks again.
AlanPosted Nov 20, 2007, 6:02 AM
I've just been trying to find a Windows Service template when I realized I hadn't got one because I'm using VS 2005 Standard Edition right now :)
But, from memory, I'm almost certain that you can't set the start parameters programatically but have to set them from Windows.
On XP pro the steps are:
1. Right click on MyComputer and select Manage -> Services and Applications -> Services
2. Right click on your service, select Properties and you should then see the Start Parameters box under the General tab.
GregPosted Nov 20, 2007, 5:54 AM
http://www.c-sharpcorner.com/UploadFile/ankithakur/Passing_parameters_to_Windows_Services10062006000204AM/Passing_parameters_to_Windows_Services.aspx
Cheers,
Greg