To log all output of a batch file to a file, you can do:
@echo off
rem https://stackoverflow.com/questions/203090/how-do-i-get-current-datetime-on-the-windows-command-line-in-a-suitable-format
for /f %%# in ('wMIC Path Win32_LocalTime Get /Format:value') do @for /f %%@ in ("%%#") do @set %%@
rem echo %day%
rem echo %DayOfWeek%
rem echo %hour%
rem echo %minute%
rem echo %month%
rem echo %quarter%
rem echo %second%
rem echo %weekinmonth%
rem echo %year%
call :LOG > D:\Humi\Backup\Humi-backup-full-%year%-%month%-%day%_%hour%%minute%%second%.log
echo SUCCESS!
echo on
exit /B
:LOG
sqlcmd -S .\SQLEXPRESS -E -Q "EXEC sp_BackupDatabases @backupType='F'"
robocopy D:\Humi\Backup \\10.0.150.15\Backup\CSARNOK-ThinkCentre1 /XC /XN /XO /zb
References: