Updated copyToClipboard to run under Windows