When I put this code in my cmd it's working perfect (See log 1). When I try the same code in a .BAT file or with a .BAT file who calls on a script its only connecting to the server and isn't doing anything anymore.(see log 2) Is there anyone who could help me with this problem?

You are missing the indentation (leading spaces), double-quotes around commands and the exit command.
And on many lines, you have spaces after the ^. That's not allowed. The ^ must be the very last character on the line.