Parfait's suggestion helped solve the problem.
I had it
@echo off
sqlcmd.exe -S "(localdb)\v11.0" -i C:\SQLBatch\CreateLinkServer.sql -o C:\SQLBatchCreateLinkServer.txt
instead
@echo off
sqlcmd.exe -S "(localdb)\v11.0" -i C:\SQLBatch\CreateLinkServer.sql -o C:\SQLBatch\CreateLinkServer.txt
therefore, the invoice is not written to the specified file.
, SQLBatchCreateLinkServer.txt, CreateLinkServer.txt SQLBatch