How to change the Startup Type of a Service with VB.NET?

D

DraguVaso

Hi,

How do you change the Startup Type of a Windows Service with VB.NET?
When using the ServiceController you can Start and Stop a Service, but I
can't find anywhere how to change the Startup Type?

Thanks a lot in advance,

Pieter
 
S

SenthilVel

Hi

You can have this code to start the service automatically :
serviceInstaller1.StartType =
System.ServiceProcess.ServiceStartMode.Automatic;

This must be added in the ProjectInstaller class.

,,,

Senthil
 
G

Guest

DraguVaso said:
Hi,

How do you change the Startup Type of a Windows Service with VB.NET?
When using the ServiceController you can Start and Stop a Service, but I
can't find anywhere how to change the Startup Type?

Thanks a lot in advance,

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top