Killing Process in a Click of Button

Naimishforu
Posted by Naimishforu under VB.NET category on | Points: 40 | Views : 2467
This will kill all Excel and PowerPoint Process.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("EXCEL")

For Each p As Process In pProcess
p.Kill()
Next

Dim pProcess2() As Process = System.Diagnostics.Process.GetProcessesByName("POWERPNT")

For Each p As Process In pProcess2
p.Kill()
Next
End Sub

Comments or Responses

Login to post response