Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Killing child processes

Killing child processes

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sam Marrocco
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups