Search code examples
c#.netprocesskill-process

Kill parent process without administrator rights


How can I kill the parent process without administrator rights? Process A creates process B, and in process B I need to kill process A.


Solution

  • You want to ProcessB to signal to ProcessA that it wants to it to stop running. ProcessA can then clean up any resources and exit gracefully (as suggested in the comments to your answer). So how does a Process signal something to another Process? That is called Inter-Process Communication (IPC) and there are loads of ways to do on the same machine or across machines including message buses, web-service, named pipes.

    A simple option is a system-wide EventWaitHandle - good example here Signalling to a parent process that a child process is fully initialised