473,543 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I prevent an application being ended by "Task Manager". Howto keep it always alive?

Dear Members
I have a critical program written in c#. It runs every time the user
log on. But sometimes log-oned user forces my application process to
quit by “End Process” in task manager.

How can I be notified whenever the process is killed by task manager?
I want to keep my process always alive. At least after it is killed, I
want it to be restarted automatically.

Is there any way?
Jul 28 '08 #1
4 6176
You could perhaps run it as a service, and not let the users have
admin access to kill that service?

Marc
Jul 28 '08 #2
I have a critical program written in c#. It runs every time the user
log on. But sometimes log-oned user forces my application process to
quit by “End Process” in task manager.
How can I be notified whenever the process is killed by task manager?
I want to keep my process always alive. At least after it is killed, I
want it to be restarted automatically.
Is there any way?
You (ultimately) can't prevent an application from being terminated by
someone with the appropriate rights. A user can normally terminate an app if
they started it but not an app started by another user. Note that you can
write a service to monitor the app and if it goes down, the service can
immediately re-start it. Of course someone can always kill the service
itself but only administrators normally. Depending on the app, you may
therefore want to write it as as a service instead (which sounds like what
you need here). Again, only administrators can (normally) terminate it. If
someone does, they do so at their own risk.
Jul 28 '08 #3
I know most places have some kind of access restriction on certain
applications. Where I used to work I was a local administrator but
someone above me made it so I couldn't do an "End Process" on Norton
Anti-Virus. You might not be looking for a coding solution as much as
an access restriction solution.

Jul 28 '08 #4
On Jul 28, 5:21*pm, "Larry Smith" <no_spam@_nospa m.comwrote:
I have a critical program written in c#. It runs every time the user
log on. But sometimes log-oned user forces my application process to
quit by “End Process” in task manager.
How can I be notified whenever the process is killed by task manager?
I want to keep my process always alive. At least after it is killed, I
want it to be restarted automatically.
Is there any way?

You (ultimately) can't prevent an application from being terminated by
someone with the appropriate rights. A user can normally terminate an appif
they started it but not an app started by another user. Note that you can
write a service to monitor the app and if it goes down, the service can
immediately re-start it. Of course someone can always kill the service
itself but only administrators normally. Depending on the app, you may
therefore want to write it as as a service instead (which sounds like what
you need here). Again, only administrators can (normally) terminate it. If
someone does, they do so at their own risk.
Thank you Larry. Your solution was a good one.
(And thanks others)

Jul 29 '08 #5

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

Similar topics

2
3246
by: John E. Hadstate | last post by:
Please forgive the heavy cross-posting and feel free to delete inappropriate groups when you reply. I am really at a loss and hope someone has an answer for my problems. Environment: Redhat Enterprise 3, Gnome or KDE, Generic PC, 1.5 GHz P-III CPU, 256 MB RAM, Sun JRE 1.5.0_2. (These problems present on multiple hardware...
4
1997
by: Al Dykes | last post by:
I'm going to be collecting lots (a few thousand) email addys. Each of these people will be interested in recieving mail on one or more topics, with an open ended and growing number of topics. Mailman with a BD application behing it might be ideal as it would let users add and delete themselves and each topic would have it's own email list...
4
3713
by: Leeor Chernov | last post by:
Hi , I Used the object Excell Application(COM INTEROP) and it is staying as an open process, And the owner(User Name) is ASPNET Altough I try to release it with : System.Runtime.InteropServices.Marshal.ReleaseComObject, And GC.Collect. Every time I am opening a new Excel.Application() , I get more Processes in memory. Note: I am calling...
4
15899
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager, I'd like to be notified. I tried few combinations of Close, Closing, Application.Exit method, ApplicationExit Event, etc, but nothing seems to be...
4
3342
by: Niron kag | last post by:
Hi, I have a windows service, which is currently installed, on my local computer. The problem is that when I look at the task manager, I see that the “Mem Usage”, become bigger and bigger. Has someone any idea why this happens? Anyway to solve this problem I thought to stop the service and start it programmatically when it’s “Mem...
4
1719
by: ray well | last post by:
on my developing system, when my app exits, it always gets removed withing a second from the task manager. on my clients machine, the app exits but stays indefinitely in the task manager. i tried every which way to kill the process, i did all of the following to no avail: in the module whose sub main loads the form and then starts...
1
2998
by: Brad Pears | last post by:
I am working on a vb .net 2005 project. Recently I wanted to changed the location of my builds from debug to release. I clicked on the 'Build option and for some unknown reason, the "configuration manager" item is now missing. It was there earlier in the day!! So I right clicked in the menu area at the top, selected 'Custom', then selected...
4
13261
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect it: if (e.CloseReason == CloseReason.TaskManagerClosing) { MessageBox.Show("from task manager"); }
4
6693
by: tvnaidu | last post by:
How can I cheack CPU load on LINUX like "Windows Task manager" on Windows?. Windows task manager shows CPU load (percentage) and etc, any tool in LINux?. I know "top" command which shows which process running at highest priority right?. thanks.
0
7402
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
7590
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. ...
1
7344
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
7684
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
4890
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
3388
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
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1814
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.