473,387 Members | 1,573 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,387 software developers and data experts.

Service not starting after reboot

I have a c# windows service that works fine when started manually. The
Startup type is set to automatic, yet if the machine rebotted, the service
fails to start unless I start it manually.

The service needs to have SQL Server running first and I came across this
article
http://support.microsoft.com/default...roduct=win2000
which explains how to setup a 'DependOnService' registry value. When I try
to do this on a Windows 2000 machine, the only options I have are, String,
Binary and DWORD. How do I programatically create a 'DependOnService' with
data type REG_MULTI_SZ

Thanks

Aplogies if this is wrong discussion group - I wasn't sure where to post.


Dec 4 '06 #1
1 4071
"jez123456" <je*******@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
>I have a c# windows service that works fine when started manually. The
Startup type is set to automatic, yet if the machine rebotted, the service
fails to start unless I start it manually.

The service needs to have SQL Server running first and I came across this
article
http://support.microsoft.com/default...roduct=win2000
which explains how to setup a 'DependOnService' registry value. When I try
to do this on a Windows 2000 machine, the only options I have are, String,
Binary and DWORD. How do I programatically create a 'DependOnService' with
data type REG_MULTI_SZ

Thanks

Aplogies if this is wrong discussion group - I wasn't sure where to post.
Don't mess around in the registry, use the tools provided by the system to configure your
Windows Services.
From the command line you can use sc.exe, from managed code you can use System.Management
and WMI or you can spawn sc.exe using System.Diagnostics.Process.
Search MSDN for details on sc.exe or enter sc config /? from the command line.

Willy.
Dec 4 '06 #2

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

Similar topics

9
by: Alan Pretre | last post by:
I have a Windows service that is having trouble starting up at boot time. It requires SQL Server to start up. I have added MSSQLSERVER to the service dependencies (as explained in...
2
by: Razzie | last post by:
Hey all, I wrote a Windows Service. When I test it on my developement machine (winXP) it works fine. It starts ok, never crashes, etc. When I install the service on another machine (win2000) it...
29
by: Ken Allen | last post by:
I have a number of services developed in C# (.Net), and they have been working fine for the most part. Recently someone reported that ipon occassion (originally rarely, but more frequently on some...
23
by: Adam Clauss | last post by:
I have a C# Windows Service running as the NetworkService account because it needs to access a network share. As part of the service's initialization, I want the service to terminate, if an...
0
by: tshad | last post by:
I have a Windows Service I created that just sets a timer and writes to EventLog every 10 seconds. It installed fine and it actually starts. But it says it doesn't. The progress bar shows the...
3
by: Johnny Fugazzi | last post by:
OK, I created my handy little windows service and created an MSI installer using the Deployment tool in VS.net with Custom Actions according to the msdn help. Worked great, with one little...
3
by: tshad | last post by:
I created a service in VS 2003 and the code works fine as an application, but not as a service. It installs fine, but when I try to start it, it tells me it was unable to start. Am I missing...
3
by: keepyourstupidspam | last post by:
Hi, I have written a service that can start and stop normally using net start and net stop but when I reboot the machine the serivce does not restart. The code seems to bomb out on the...
8
by: DF Dev | last post by:
I have created a Windows Service using Visual Studio .Net 2005 and C# which executes a series of database jobs on a time basis. I am using SqlConnections and SqlCommand objects to connect to a SQL...
0
by: s.kapitza | last post by:
Hi, try M$S servicebug 3 regards s.kapitza alghaden@alumni.fdu.edu (Ahmad) wrote in message news:<4a75f4b7.0308080649.49105373@posting.google.com>...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.