Great, I suspect that the problem is that when the script is tokenized it mangles the username and password because they are un-quoted text. Putting them in variables protects them.

Putting the username and password in quotes (") might also work.