This is what we have so far, which works, but it writes out line breaks to the file. We would like to not send the CRLF character if at all possible.
set @dosvar = @JobNumber
set @doscmd2 = 'ECHO' + @dosvar +' >> \\test1\websites\testcontrol\js\misc1.js'
Exec master..xp_cmdshell @doscmd2
Thanks
You could try this trick:
If you run this batch file:
It prints:
So it seems to work.