Windows Service Parameter problem in WinXP

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
I'm writing a Windows Service for reading data from COM port under WinXP. The service requires startup parameters.

I have no problem reading the parameters from Environment.GetCommandLineArgs(). However when I type the parameters at the "Service" MMC panel, the value is lost whenever I press "OK" to close it.

I've tried to set it to "manual" then "automatic" again just to make the "Apply" button enabled. But it also doesn't keep the value when "Apply" is pressed.

I've tried Close the service, set the parameters, then Start it again. The parameters doesn't pass to the service when it starts... and lost when "OK" is pressed.

It seems to me the "startup parameters" box is not connected to anything... is it a bug or it is to be used with some fancy special way?

Meanwhile I just go to HKLM\SYSTEM\ControlSet001\Services\\ImagePath and append the parameters there, but ask the user to change COM port setting doesn't sound good to me. I wish it could be done using a more standard way - using the MMC Service panel.



More...

View All Our Microsoft Related Feeds
 
Back
Top