4

We have a web application that has to launch other processes. Typically these processes are batch files that launch a series of other processes. Sometimes we need to kill a batch file process that is running and to do that we need to kill it and its children.

What is the best way to go about this in .Net?

Simon P Stevens
  • 27,303
  • 5
  • 81
  • 107
Jeffrey Cameron
  • 9,975
  • 10
  • 45
  • 77

1 Answers1

0

This is an old thread but posting here in case someone else also looking for the answer

  1. To run a batch file in admin mode : how to use c# run batch file as Administrator to install windows services

  2. To programmatically kill process tree : Kill process tree programmatically in C#

combining them should do the job.

hope it helps.

Baljeetsingh Sucharia
  • 1,990
  • 1
  • 19
  • 37
  • 1
    You can also write a monitor that checks if the batch is not responding , a not-responding checker and then programatically kill it – Kush Dec 13 '18 at 08:59