简体   繁体   中英

Prevent users from stopping a process

Long story short, I need to create an application that monitor the sound volume on a computer. The computer's user must not be able to stop the application no matter what.

I'll need to make my app start on computer start up, so the user can't just restart it to enter his session without the application running. As of now I don't know precisely how to do it but with some research this shouldn't be a problem.

My biggest concern is if he just stops the process in the task manager. I guess that I can't avoid that programmatically ? Is there a way to just modify the session's right so that it can't stop processes in the task manager? Or any other solution I didn't think about ?

Or there is no way I can do that and I'll just have to trust my user not to ever stop the program in the task manager ?

Thanks in advance for your help. :)

PS : This will run on a computer in a student club that runs the music for the club and that anyone can access. There are chambers where people sleep the floors above so we don't want people to put the volume too loud. That's it. No malware or anything.

In general, the only programs that act like that are malicious (eg rootkits ). If you think about it, you really wouldn't want programs to be able to act like that.

As others have indicated, the closest you'll get here is a Windows Service, which automatically starts with Windows. Average users won't know to stop it, but it's still possible to stop it manually for power users.

One work-around you could try is to periodically have it call a web service to verify that it's running. That way you could tell who might have uninstalled or stopped the service. (The problem, of course, is that they might just not have their computer on or something; you could have separate calls for "Start" and "Still On").

Alternatively, if this installed only on computers that are exclusively under your direct control, as others have indicated, you could configure things so that you need administrative access to stop the process. This option was addressed in the comments.

I'm not accusing you of malware - just wanted to illustrate how bad it would be if you could easily make a program that the user can "never stop".

So no you can't make a program that a computer-savvy person could never stop.

But from what I gathered....

Sounds like you want to make it a service. https://msdn.microsoft.com/en-us/library/d56de412(v=vs.110).aspx .

Another (easier I think) option is just to make a console app that starts up from the Task Scheduler http://www.c-sharpcorner.com/uploadfile/manas1/console-application-using-windows-scheduler/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM