I have never needed to run the
command but I have other BAT files that I use for scheduled maintenance of my database. Below is an example using your SQL commands.
containing these statements:
cd C:\Program Files\Microsoft SQL Server\110\Tools\Binn
SQLCMD -S YOURCOMPUTERNAME\SQLEXPRESS -E -w 166 -e -i C:\BAT\ShrinkDB.sql -o C:\BAT\ShrinkDB.log
After execution, C:\BAT\ShrinkDB.log will contain the output of SQLCMD.
containing the SQL commands:
ALTER database dbName SET RECOVERY simple
DBCC shrinkdatabase (dbName)
3. Use Windows Task Scheduler to schedule