Is there a way to detach a process, from a JobObject? My problem is, that if i create a new process with RunAs, like cmd.exe, then it will be assigned to a JobObject automatically. And if I want to run my application from this cmd it will also be assigned to this jobobject. The problem starts here, because my application would create a new jobobject and create a new process and then assign it to my new JobObject, but it can't associate, because the first cmd started with runas, is already assigned to a jobobject, and so the new process what I created is also assigned to this jobobject.
So my question is, how can I detach the first cmd from the jobobject which will be automatically created, or how else can I solve this problem?