I've done this before, but not for some time and i can't find the source. So anyways, how can you find,kill, and wait for a process to finish closing before executing another.