473,498 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stopping a windows Service while "starting"

I have a windows service that I am developing in VB.Net and during it start
up process, I am checking various things. If there is an error encountered
while doing these checks, I would like to halt the startup process (and stop
the service) and then also like to disable the service, if possible.

I have tried using the ServiceController class to gain access to the
service, but when I issue a Stop method, it appears to work, but the service
continues the start process and eventually shows Started as the status.

Any ideas or article references?

Any help would be greatly appreciated.
--
Joel Zinn
Sr IT Architect
American Electric Power
Oct 17 '05 #1
1 1515
One way would be to throw an exception.

Brian

Joel Zinn wrote:
I have a windows service that I am developing in VB.Net and during it start
up process, I am checking various things. If there is an error encountered
while doing these checks, I would like to halt the startup process (and stop
the service) and then also like to disable the service, if possible.

I have tried using the ServiceController class to gain access to the
service, but when I issue a Stop method, it appears to work, but the service
continues the start process and eventually shows Started as the status.

Any ideas or article references?

Any help would be greatly appreciated.

Oct 17 '05 #2

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

Similar topics

3
8576
by: Greg Bryant | last post by:
I'm doing some work for a company that has an auction site running in coldfusion. They're not real happy with it, and it needs a major overhaul, so I'm looking at redoing it, and while I'm at it,...
0
1432
by: pillbug22 | last post by:
Hi everyone I am trying to write a fairly simple VB.NET service (use a timer to poll a network location for a file, if file exists, send message) The service correctly start, stops, runs the...
7
8637
by: Mullin Yu | last post by:
if i put the same code at the windows application or console, i can logon to the computer. but, if i put the same code at the windows service and start it, i still can't logon to the machine. ...
19
2611
by: VB Programmer | last post by:
If I have a VB6 and a VB.NET application, or 2 VB.NET applications what is the best way to "talk" between them? They both run on the same PC. Right now I'm just using text files to share...
3
1874
by: gregory_may | last post by:
According to this article, I cant change "CanStop" on the fly!!! ...
1
280
by: Joel Zinn | last post by:
I have a windows service that I am developing in VB.Net and during it start up process, I am checking various things. If there is an error encountered while doing these checks, I would like to...
0
1475
by: Brian | last post by:
Greetings group! I've got a weird one. I have an ASP.NET 1.1 application that has been running on a dual-processor Windows 2000/IIS 5 server for a couple of years. Global.asax has an...
1
6553
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I'm puzzled by an error message encountered while creating a Windows Service. In particular, I'm creating a second Windows Service within a Windows Service project, using Visual Studio 2005. The...
1
2246
by: tvnaidu | last post by:
Redhat machine boot stops at "Starting Portmapper" always, I have to press ctrl-D and enter key, then it starts, how can I fix that?
0
7125
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
7002
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...
0
7165
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
7379
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...
1
4908
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...
0
4588
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...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.