Not sure if this helps but if I run it from a batch file it works OK. I suppose I could shell the batch file out but that seems very messy.