You can create a thread given a delegate to method, can I create a process in the same way? I want to do that to be able to close the child process from task manager if something goes wrong.
I expect the answer is no and the only typical way is windows service.
Thanks
If by “same way”, you mean passing a delegate as an argument for a given process then no, this is not possible. You will have to create a new executable which would do some tasks based on command line parameters. Though, the general rule is to avoid process spawning as it’s VERY expensive.