• Well then you will need to write a command line based application which interfaces with SQL SMO and script out your database to a file.

    As detailed, do a search for "Script Database via Command Line" and you will find help on what you want to do.