Killing child processes
-
I'm running an .exe file (which I did not create) using a Process class and it's accompanying .StartInfo data as follows: m_Process = New Process With m_Process.StartInfo .FileName = "cmd.exe" .Arguments = "/C " & CompleteCommandLine .UseShellExecute = False .CreateNoWindow = True .WindowStyle = ProcessWindowStyle.Normal .RedirectStandardOutput = False .RedirectStandardError = False .RedirectStandardInput = False End With m_Process.EnableRaisingEvents = True AddHandler m_Process.Exited, AddressOf UniqueProcessThread_Exited m_Process.Start() G_RenderProcessID = m_Process.Id This allows me to have an asynchronous process that runs my command-line application, but I can get the processid in case I need to kill the process prematurely. However, the killing of this process by it's id *only* kills my process--not any child tasks that the .exe may have spawned. Is there a way to forcibly kill *every* task that has been spawned by my process using only the processid I have using vb.net?