这是我为我的应用程序制作的简单代码行。基本上Button_2
运行“batchfile.bat”。现在,我很好奇如何Button_1
结束“batchfile.bat”或关闭 CMD,因为这就是“batchfile.bat”运行的原因。任何帮助表示赞赏,谢谢。
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Process.Start("C:\batchfile.bat")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
(MY DESIRED CODE TO KILL CMD HERE)
End Sub
End Class