Are all the databases on the same server or are the servers different as well? If they are all on the same server you should put a "USE databasename" inside each .sql-file to make sure that the scripts are executed in the right one.
Here is .bat-script you can use to run all .sql-files in a folder using sqlcmd:
@FOR /f %%G in ('dir /b %scriptdir%*.sql ') DO @sqlcmd -S myServername -i %scriptdir%%%G
My blog-> http://thefirstsql.com