473,769 Members | 5,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.service Process.Service Installer()' 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 6133
The ServiceInstalle r 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.u k> wrote in message
news:n4******** ***********@fe1 .news.blueyonde r.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.service Process.Service Installer()' 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 ServiceInstalle r 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.ServiceP rocess.ServiceI nstaller. Do this by using
"Add/Remove Item" option from right clicking on the "Components " tab in
ToolBox. Find the "ServiceInstall er". Select it.
2. Drag the ServiceInstalle r 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.S tartType =
ServiceStartMod e.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.service Process.Service Installer()' 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\S ystem\\CurrentC ontrolSet\\Serv ices\\ 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.u k> wrote in message
news:n4******** ***********@fe1 .news.blueyonde r.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.service Process.Service Installer()' 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.ServiceP rocess.ServiceC ontroller class. It allows
programmattic control of many service properties.

"Paul Aspinall" <pa**@aspy.co.u k> wrote in message
news:n4******** ***********@fe1 .news.blueyonde r.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.service Process.Service Installer()' 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
1317
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 profile." means. What is the mail client? I have already setup the mail profile but when I go to SQL Mail on Services and try setting it up, the profile I created is not showing on the pull down list. I appreciate any assistance. Thanks.
1
11069
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 systanx correct, if so why it's not work.If the
1
461
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 start and when I check the startup type it has been chaanged back to manual. When I start the servie manually it runs fine, so I don't think that there's a permissions issue.
4
2492
by: Sam | last post by:
Service properties ------------------ Log On As: LocalSystem Logon account has full admin privileges. OnStart() routine ----------------- { EventLog->WriteEntry ("Commencing..."); .... A
11
14975
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. Every now and then, when I stop the service from the Services applet, it will timeout and bring up an error message saying that the service isn't responding.
4
3919
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. I used VS.NET 2003 to create a C# client that successfully processes SOAP messages to and from the Java service. However, I'm having problems with the C++ client. I created a new solution and a new project with File > New > Visual C++ Projects...
12
5342
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 the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
4
4182
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 check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
1
6509
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" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
0
9583
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.