Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Service StartMode

Status
Not open for further replies.

traceytr

Programmer
Mar 13, 2001
94
US
Greetings!

I'm writing a Windows service in VB.NET 2003, and I cannot find where to change or verify the StartMode. I think the default is Manual, but I'd like to verify that before installing and testing my service. Also, once the testing is completed, I'll need to change the StartMode to Automatic. I have looked everywhere... Everywhere, except for the right place. Thanks for any advice. It is always appreciated.

Tracey
 
To check the service status as follows:

Dim serv2 As New System.ServiceProcess.ServiceController("name of service", "server name or ip")
servstat = serv2.Status.ToString()

To change the service start method as follows:
Go to (MS owns this site) and download psTools. You will need the psService tool to change the start modes programatically. Shell the PsService exe hidden with the right parameters and you can remotely turn on, off, start, suspend the services. The help file with psttools has the syntax you must pass.

Works well...
~CIAO
 
I think I asked the wrong question. I kept looking, and I found the StartType (not StartMode) property of the ServiceInstaller object. The default is Manual, but I wanted to make sure. Thanks!

Tracey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top