Save Results of DBCC ShrinkFile
The easiest way I see it is a batch file using sqlcmd:

sqlcmd -S .\SQL2008R2 -E -Q "dbcc loginfo" &gt;&gt; log.txt


The redirect operator appends data at the end of the file.

-Q parameter was used for closing the sqlcmd session immediately.