My first guess is that there is a Windows "special character" inside the password.
Purely for testing purposes to see if I'm correct, create a second SQL Authenticated user with only letters and numbers in both the user name and the password (no special characters at all). Modify your script to use this username and password.
If the modified script will run using the sanitized username and password, then we need to explore which characters you are using and how you need to work around the problem. You can find details at
remarks if this is the case.
-PatP