Search code examples
c++windowswindows-7processrunas

how to forbid process termination by regular user?


I cannot implement it as a windows service because my process has to interact with desktop and it's prohibited in Windows 7.

What is the simplest way to accomplish this? Starting under another (privileged) user? How to do this?

My users are not hackers, just an operators, so some "dumb" methods like hiding from task manager would help too.

EDIT: some clarification according to provided answers

my process doesn't have any GUI, so I'm trying to avoid killing the process from task manager

my process is a client of a supervising system that has to monitor user's desktop, so it has to interact with desktop

EDIT 2:

can I use a windows service that will start separate process in user session under system account (since my service is running under system account)? can user kill this child process?


Solution

  • after long digging I found acceptable answer here: Prevent user process from being killed with "End Process" from Process Explorer

    works fine if you're logged in as a regular user, you cannot kill the process from Process Explorer. Admin still can kill it because has sufficient privileges. it's exactly what I needed