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

A

AliRezaGoogle

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?
 
L

Larry Smith

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.
 
M

Marc Gravell

You could perhaps run it as a service, and not let the users have
admin access to kill that service?

Marc
 
C

cfps.Christian

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.
 
A

AliRezaGoogle

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)
 
Joined
Jul 3, 2010
Messages
1
Reaction score
0
(e-mail address removed)
i made a program that is 40 kb and nothing can terminate it
and i can add some code to it so it will watch your application and as soon as anything closes it my program will open it again !!
what do you think?
just send me an email with these two parameters
1- your application name(the one in the task manager's process tab)
2- your application path (like c:\mayapp.exe)
just mail me
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top