title: "bat file" to run SQL log file shrink task
body: <p>I have a SQL2012 DB that has a log file growing very rapidly. I have a 3rd party program doing full database backups so I'm not worried about that. 
  I have the command to run in the SQL manager to shrink the log file and that is working but it's a very manual task. </p>
  
  <p>I'm trying to create a script that I can schedule to run every 2 weeks but a BAT file won't work it seems as after the <code>sqlcmd -S servername\instancename -E</code> command is run it just goes to 1> and stops. I need to run the USE and DBCC commands but not sure how to achieve this. </p>
  
  <p>I have tried looking online but nowhere can I find a way to make a double click script to run this <code>DBCC SHRINKFILE</code> task. </p>
  
  <p>So using sqlcmd, I can do this:</p>
  
  <pre><code>USE DBNAME
  GO
  DBCC SHRINKFILE (DBNAME_20070302091322_Log, 1);
  GO
  </code></pre>
  
  <p>Running manually the file shrinks to below 10mb and that is correct. I need to just automate this task.</p>