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

How to : Don't Allow AnyBody to Stop/Kill my Windows Service

Hi,

I''m developing a windows service using C#.Net, which runs in System Account.
I don't want that service to be stop manually and
I don't want anybody to terminate / kill my service at any cost.

If at all, he/she is terminating/killing/stopping the service is done ...
I need to send a email.

Can anybody help me out with this....

I'm very new to windows services .... and C#.Net
Appropriate Coding / Suggestion will be appreciated ...

Have a nice day.

Thanks
Mahender
Jul 17 '08 #1
3 1653
Plater
7,872 Expert 4TB
Well I don't know about in code, but in the windows service manager (services.msc) there are settings for what to do if a service is stopped and how many times to do that action, etc.
Jul 17 '08 #2
Well I don't know about in code, but in the windows service manager (services.msc) there are settings for what to do if a service is stopped and how many times to do that action, etc.
Thanks ... for your inputs.

How do I do it in coding ....
Jul 21 '08 #3
Plater
7,872 Expert 4TB
Thanks ... for your inputs.

How do I do it in coding ....
Well when your service gets the closing signal....tell it to re-open itself?
That's very virus-like of you to demand that your service cannot be stopped or killed, but it would probably work.
Jul 21 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fred Blair | last post by:
Got mysql started, created root password. Decided to change it and used mysqladmin to try and change. It says access denied. I tried to stop the service, can't do that. I even restarted the...
2
by: 0to60 | last post by:
I have a windows service that when started creates two threads: one thread that runs a TcpListener waiting for TcpClients to connect, and another thread that reads from the resulting sockets. My...
6
by: Jacobus Terhorst | last post by:
Using C#: I tried: ServiceController me = new ServiceController(this.ServiceName); me.Stop(); it raises an exception: Cannot find Service I also tried:
4
by: ucasesoftware | last post by:
i do some job in timerBaseInternet.Elapsed but i don't want to stop the service until this job is finished... What can i do for this ? and i can't use canStop to false cause it's only when...
2
by: MA | last post by:
Hi all! I have developed a webservice that writeing and reading files in different folders. I need to be able to start and stop this service by using a web interface (start and stop button)....
5
by: Dino Buljubasic | last post by:
My application can allow a user to open a file for viewing by fetching file data from database, creating the file in a temp directory and starting appropriate process (i.e. Adobe or any other...
7
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
0
by: mattcfisher | last post by:
Hi, I have two windows services running together. One is the main program, and one is an "updater" wrapper for the main. The updater service starts and stops the main one (as in you should never...
2
by: Cappamontana | last post by:
Hi, We have a .Net project containing 1 Windows Application and 3 Windows services. The project is quite complex and is still in development. The services can be started and stopped by using the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.