none
Windows Service RRS feed

  • Question

  •  

    Is there a way to write a Windows Service (or a regular Windows App) that can't be killed, even by an administrator? 

     

    Or at least, very difficult to kill without some serious effort.

     

    One of our competitors seems to do it somehow.

    Thursday, February 7, 2008 5:45 PM

Answers

  • Can you reflect the code?

     

    You can also have some monitoring process look for the service, or process running, if it is not running, then start it again, as a different idea.  That would probably be better, as you can kill the process, and stop the monitoring process from starting it again.

     

    I think you might be able to do it by catching the fact that the host is closing, and cancelling the action, but I'd have to ask why you would want to do that, as that could be seen as a virus, and if software like that was on my computer, and couldn't easily be killed, I'd have to ask myself what it was doing, and why it didn't want to be killed, and if I wanted such software on my machine.

     

    I hope this helps,

     

    Martin Platt.

    Friday, February 8, 2008 12:32 AM
  • I won't go into details here since this is an Architecture forum. You should post in the win32 forums.

     

    Basically a service will get a 'signal' that it should stop.  Quite simply it can ignore it and continue to run.

     

    You can not kill a service in say Task Manager even if you are the admin.

     

    Tuesday, February 12, 2008 4:39 AM

All replies

  • Can you reflect the code?

     

    You can also have some monitoring process look for the service, or process running, if it is not running, then start it again, as a different idea.  That would probably be better, as you can kill the process, and stop the monitoring process from starting it again.

     

    I think you might be able to do it by catching the fact that the host is closing, and cancelling the action, but I'd have to ask why you would want to do that, as that could be seen as a virus, and if software like that was on my computer, and couldn't easily be killed, I'd have to ask myself what it was doing, and why it didn't want to be killed, and if I wanted such software on my machine.

     

    I hope this helps,

     

    Martin Platt.

    Friday, February 8, 2008 12:32 AM
  • Those are both good ideas, I may have to resort to that (have another process running that restarts the service).

     

    Anyone have any other ideas?  I wish I knew how our competitor does it.  They have an service that runs under Windows XP that can't be killed, even by an administrator.

     

    > I think you might be able to do it by catching the fact that the host is closing,

    > and cancelling the action, but I'd have to ask why you would want to do that,

    > as that could be seen as a virus, and if software like that was on my computer,

    > and couldn't easily be killed, I'd have to ask myself what it was doing, and why

    > it didn't want to be killed, and if I wanted such software on my machine.

     

    The software is used to compute network resource usage for each employee.  Some employees might try to kill it to go over their quota

     

    Friday, February 8, 2008 5:33 AM
  • I won't go into details here since this is an Architecture forum. You should post in the win32 forums.

     

    Basically a service will get a 'signal' that it should stop.  Quite simply it can ignore it and continue to run.

     

    You can not kill a service in say Task Manager even if you are the admin.

     

    Tuesday, February 12, 2008 4:39 AM