Finally I used two .bat files.
I have the parameters user, server, password and database name.
I connect to the idle instance (force to use connect reset because either I ewas connected to a database, I don't know which one?)
In the second .bat file I create the database and then I run the sql files with the other objects (tablespaces, tables etc)
The only solution is to create the database in the bat and not in the sql file.
Thanks.