473,321 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Setting a service to MANUAL

Hi
I have a service installed, but I want to programatically set it to 'Manual'
startup, rather than 'Automatic'.

I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I don't
actually install the service (MSDE does), but I want it set to Manual, and
my app starts and stops it.

I can Start and Stop the service, but need it to be Manual, and not
Automatic

Any help appreciated
Thanks
Paul
Nov 16 '05 #1
4 6104
The ServiceInstaller class has a property called 'StartType' this defaults
to 'Manual'. Is this being set to 'Automatic' somewhere in your code?
--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:n4*******************@fe1.news.blueyonder.co. uk...
Hi
I have a service installed, but I want to programatically set it to 'Manual' startup, rather than 'Automatic'.

I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I don't actually install the service (MSDE does), but I want it set to Manual, and
my app starts and stops it.

I can Start and Stop the service, but need it to be Manual, and not
Automatic

Any help appreciated
Thanks
Paul

Nov 16 '05 #2
Hi,

You can use the ServiceInstaller class to set the same. For this, you need
to do the following (You could have done some of them already)
1. Reference the System.ServiceProcess.ServiceInstaller. Do this by using
"Add/Remove Item" option from right clicking on the "Components" tab in
ToolBox. Find the "ServiceInstaller". Select it.
2. Drag the ServiceInstaller and name it (lets say "testinstaller"). You
will see an entry in the "Component Designer generated code" section in your
project.
3. Now in your install event, you can say, testinstaller.StartType =
ServiceStartMode.Manual.

You can see an example here...
http://www.codeproject.com/csharp/csharpsvclesson2.asp

Hope this helps.

Ganesh
"Paul Aspinall" wrote:
Hi
I have a service installed, but I want to programatically set it to 'Manual'
startup, rather than 'Automatic'.

I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I don't
actually install the service (MSDE does), but I want it set to Manual, and
my app starts and stops it.

I can Start and Stop the service, but need it to be Manual, and not
Automatic

Any help appreciated
Thanks
Paul

Nov 16 '05 #3
Hi Paul,

If you want to do it from code, after the service is installed you have to
change it in the registry , in
LOCAL_MACHINE\System\\CurrentControlSet\\Services\ \ change the Start value,
2 is auto , 3 is manual.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:n4*******************@fe1.news.blueyonder.co. uk...
Hi
I have a service installed, but I want to programatically set it to
'Manual' startup, rather than 'Automatic'.

I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I
don't actually install the service (MSDE does), but I want it set to
Manual, and my app starts and stops it.

I can Start and Stop the service, but need it to be Manual, and not
Automatic

Any help appreciated
Thanks
Paul

Nov 16 '05 #4
Use the System.ServiceProcess.ServiceController class. It allows
programmattic control of many service properties.

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:n4*******************@fe1.news.blueyonder.co. uk...
Hi
I have a service installed, but I want to programatically set it to
'Manual' startup, rather than 'Automatic'.

I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I
don't actually install the service (MSDE does), but I want it set to
Manual, and my app starts and stops it.

I can Start and Stop the service, but need it to be Manual, and not
Automatic

Any help appreciated
Thanks
Paul

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maligaya Park | last post by:
How do you setup SQL Mail? I tried following the procedures on the online manual but I do not understand what "On the instance of SQL Server, start the mail client using the newly created mail...
1
by: Mike John | last post by:
I want to install a service that I made in .Net. I have trying the following in the Visual Studio .NET Command Prompt: installutil C:\myservice.exe The above syntax did not work. Is the...
1
by: DevMountain | last post by:
I am running the ASP.NET State service on 3 servers and one workstation. I have set the startup type to 'Automatic' on all instances. After rebooting any of these machines, the service does not...
4
by: Sam | last post by:
Service properties ------------------ Log On As: LocalSystem Logon account has full admin privileges. OnStart() routine ----------------- { EventLog->WriteEntry ("Commencing..."); .... A
11
by: Frank Rizzo | last post by:
Hello, My c# based windows service takes a while to dispose. I have to release bunch of resources all over the place and unfortunately it can take 20-40 seconds before I can cleanly exit. ...
4
by: Mike Woinoski | last post by:
(I'm new to VS, so please forgive me if this is a faq.) I'm writing some Java web services and need to test them with C++ clients. I can use either a Windows Form application or an MFC application....
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.