This code is usefully if your application output value is full path.
Vb.net Code:
Try Dim filePath As String = "C:\Users\user\Desktop\appname.exe" Dim folderPath As String = IO.Path.GetFullPath(filePath) Dim Namer As String = IO.Path.GetFileNameWithoutExtension(filePath) For Each p As Process In Process.GetProcessesByName(Namer) p.CloseMainWindow() p.WaitForExit(10000) If Not p.HasExited Then p.Kill() End If Next Catch ex As Exception MessageBox.Show(ex.Message) End Try




Reply With Quote