VB version here.
You can use the .NET Process class to close an external application. First you must create a Process object that represents the application. You can then call Kill on that Process to force the application to close. That's the only way to close applications that don't have a GUI but, for those that do, it's better to call CloseMainWindow first and only call Kill as a last resort. It's like the difference between just throwing someone out and asking them to leave first. CloseMainWindow gives the application a chance to clean up before exiting, while Kill just removes it from memory. E.g.
The process name is what gets displayed in Windows Task Manager.
private void CloseProcessesByName(string processName)
foreach (Process p in Process.GetProcessesByName(processName))
// Ask nicely for the process to close.
// Wait up to 10 seconds for the process to close.
if (! p.HasExited)
// The process did not close itself so force it to close.
// Dispose the Process object, which is different to closing the running process.
NOTE: Code converted using Instant C# by Tangible Software Solutions.