in reply to How to end a process started with open "cmd |" before it has output
This worked perfectly thanks !! I missed that line when I was reading the docs.