473,569 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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 1660
Plater
7,872 Recognized Expert Expert
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
mahenderp
2 New Member
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 Recognized Expert Expert
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
8902
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 computer and it says there is still a connection on localhost:3306 and it can't make changes. I have deleted mysql and completely re-installed. ...
2
5271
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 stop code .Abort()s the threads and .Stop()s the listener. One one of my computers, the service runs like, well...a service. It starts and stops...
6
28477
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
1924
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 service is not running... any idea ?
2
7208
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). But I can´t find any way to this. Any ideas? And where can I see if this service is running? /Marre
5
4587
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 depending of file type) to open the file. when I close my application, it is suppose to clean all files it created in temp directory. I do this by...
7
7219
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 this error. I want to restart my windows service every time the COM object throws an error. I use System.ServiceProcess.ServiceController to...
0
2185
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 start or stop main service manually, only updater). On most computers it works great, the updater's onStop() can start and stop the main service...
2
3243
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 application. Also there are some timers in it which triggers the service on a specific time to start (scheduled). When the service done it stops itself...
0
7703
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...
0
7619
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...
0
8138
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...
1
7681
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...
0
7983
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...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
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...
0
3662
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...
0
950
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.