简体   繁体   English

如何在C#/ .Net中模拟最终进程树

[英]How can I emulate End Process Tree in C#/.Net

We have a web application that has to launch other processes. 我们有一个必须启动其他进程的Web应用程序。 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? 什么是在.Net中解决这个问题的最佳方法?

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 要以管理员模式运行批处理文件: 如何使用c#运行批处理文件作为管理员来安装Windows服务

  2. To programmatically kill process tree : Kill process tree programmatically in C# 以编程方式终止进程树: 在C#中以编程方式终止进程树

combining them should do the job. 结合他们应该做的工作。

hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM