Search code examples
c#wpfwindows-10startup

App to run on startup for all users, but needs admin to close


I'm trying to build an application that would run on startup for all users, but non-admin users shouldn't be able to close it. I apologize if this has been answered, but I cannot find the answer even after googling it.


Solution

  • Sounds like it is a system level process, that is only marginally controlable by the Administrator. Controling System processes is one of the Admin tasks.

    The two ways to start something with Windows are:

    • Make it a service. However do note that services operate under severe limitations, like not be able to create GUI themself. If you want to have any UI, you have to use a seperate process that talks with the service with IPC.
    • Have the Windows Task Sheduler start it on Windows Startup, using the Admin Account. The sheduler has replaced services in many cases, even for builtin processes like the automatic defragmentation.