Public Function KillProcess(ByVal procName As String) As Boolean For Each p As Process In Process.GetProcesses If p.ProcessName.StartsWith(procName) Then Try p.Kill() Catch End Try ElseIf p.MainWindowTitle.StartsWith(procName) Then Try p.Kill() Catch End Try End If Next Return (True) End Function 'Usage' KillProcess("explorer")
Edited by iBotPeaches, 14 February 2010 - 12:33 PM.