Hi Ben, thanks very much! I've finally had time to replace my BAT file with the code you provided and it works a treat!
Not very likely i'll be at Kaseya Connect as it's in the US and i'm on some horrible little island called England, but i would be happy to buy you a beer for this! :-)