I'm trying to run a .bat on SQL Server:
exec xp_cmdshell 'C:\prueba_bat.bat'
when I execute the output is:
f" >> archivo_union.txt was unexpected at this time. NULL
I want to join all the files and make only one and bluk the new file
My .bat code is
@echo off
cd C:\Users\jlroja01\Documents\Download\Servicio\
for %f in (*) do type "%f" >> new_files_united.txt
pause
exit
If I execute it from the cmd prompt, it works.