Windows Services configuration

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi...

After I installed my .net windows service, I tried to control some of the
behavior with the Start Parameters: in the services control parameter.

I can put a value in the box but for some reason it never gets saved (I open
the properties right after, and the box is empty). How does one persist a
value in the Start Parameters box for a service?

Thanks
-Mark
 
Hello Mark,

From your description, you've developed an .net windows service program and
you're wondering how to supply some startup parameters for the service
application/exe. You've tried using the "start parameters" setting in
service control manager, but it doesn't persist it, correct?

Based on my research, the "start parameters" setting in service control
manager, it only provide a interface for us to supply some on-demand
parameters, so you can use it to add some parameters at a particular time
you use service control manager to start a service(manually). For those
parameters you want the service always use at every startup time, you
should store it into the windows service's startup commandline value in
registry, you can find all the installed services under the following key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

And you can add additional commandline parameters in each service's
"ImagePath" registry value. e.g.

ImagePath="%SystemRoot%\system32\svchost.exe -k netsvcs"

Here is also a code project article mentioned manually customize the
registry value in service installer

#Install a Service using a Script
http://www.codeproject.com/dotnet/ScriptedServiceInstall.asp


In addition, since you're building the windows service through .net
framework code, I suggest you also consider put your service application's
startup parameters in the app.config file(yourservice.exe.config) file,
this is quite easy to configure and maintain.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top