Pretty simple problem which I am sure the solution is easy, but I simply cannot find the solution anywhere. Please forgive my limited understanding of batch, I am a unix person.
I have a for loop in batch which runs a script on the contents of a user-defined folder. If an error occurs, the script will output a message to the command prompt. I am logging these messages by
"%UserProfile%\Documents\Fooster\Logs\failed_log.txt" 2>&1 (
for /f %%f in ('dir /s/b %arg1%') do call R-Portable\App\R-Portable\bin\Rscript.exe Scripts\fooster_io.R %%f %arg2%
)
Now, this logs just fine, but each message is concatenated to the next without a line break. How would I insert a line break such that each message gets its own line?
I have tried:
"%UserProfile%\Documents\Fooster\Logs\failed_log.txt" 2>&1/n
"%UserProfile%\Documents\Fooster\Logs\failed_log.txt" 2>&1 /n
"%UserProfile%\Documents\Fooster\Logs\failed_log.txt" 2>&1 echo.
"%UserProfile%\Documents\Fooster\Logs\failed_log.txt" echo. 2>&1
All do not produce the desired results. Any ideas?