I have developed a Windows Service to prevent user from using the camera on group of computers. However, I am trying to find a way to ensure the service is never deleted. I tried CanStop in .NET property but the service was still deletable sc delete , not to mention that registery is another way of doing so.

I know it is not correct to have an aggressive application/service. However, I would like to know how to control bunch of PCs in such that there is a master and client PCs.

so far the solution I have as follow:

  1. set CanStop = false
  2. Monitor the service status of the clients from a master PC System.ServiceProcess
  3. Start the service if it's stopped remotely

FYI: I am not looking into domain solution.

  • 9
    I can't imagine there is any way to do this. Normally, this is what user permissions are for, so you install the service as an admin and then disallow non admin users from removing it. – Turksarama Sep 18 '19 at 3:46
  • yes, I agree. but I am still looking into software design. I think my solution is good but looking for inputs – Abdulkarim Kanaan Sep 18 '19 at 5:03
  • 1
    so you want to make spyware that cannot be removed. And you want us to help you make it? – jwenting Sep 18 '19 at 5:30
  • Honestly if you want users to not use the camera then the best way is with direct hardware modification. Put some liquid nails over it. – Turksarama Sep 18 '19 at 6:02
  • Physically remove the cameras. The user cannot then use them under any circumstance, even with a boot to linux disc... – Kain0_0 Sep 18 '19 at 6:26

If the users of those "client PCs" have full administrative rights over their computer, then there is no technological way to prevent them from disabling or removing your service. And if there were, you would also be locked out if the service was no longer needed or if it malfunctions.

If the users don't have administrative privileges, then it is just simply making sure that controlling the service requires admin rights. And that includes access to the relevant files and/or registry keys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.