这是我为我的应用程序制作的简单代码行。基本上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