Automating the creation of a SQLite database from a batch file Automating the creation of a SQLite database from a batch file shell shell

Automating the creation of a SQLite database from a batch file


Try to call it like that:

echo .quit | sqlite3.exe 

Or put .quit in the end of your file.


It seems (since you haven't shown its contents) that the bat file is missing the exit statement. You can add it yourself:

sqlite3.exe -init schema.sql default.db3 .exit


I had the same problem with sqlite3 3.11 (but not with 3.8) and the solution that worked for me was:

sqlite3.exe default.db3 < schema.sql

And Regis's answer worked fine as well.