This snippet will kill a current running process in VB.NET. To load snippet go File>New Project>Console Application
Module procKill
Sub main()
System.Console.Writeline("What process would you like to kill (IE: notepad)")
Dim kProc = System.Console.Readline()
Dim pList() As System.Diagnostics.Process = _
System.Diagnostics.Process.GetProcessesByName(kProc)
For Each proc As System.Diagnostics.Process In pList
Dim resp As MsgBoxResult
resp = MsgBox("Terminate " & proc.ProcessName & "?", _
MsgBoxStyle.YesNo, "Terminate?")
If resp = MsgBoxResult.Yes Then
proc.Kill()
End If
Next
End Sub
End Module