This was an excellent idea.
I needed the same for my car navigation project, but it is written in C#, so I will post this for you:
Code:
Process[] procs;
procs = Process.GetProcessesByName("MapPoint") ;
if(procs.Length > 0)
{
for(int i=0;i<procs.Length;i++)
{
procs[i].Kill() ;
procs[i].WaitForExit();
}
}