I need to add logging to a batch file to know what parameters were passed to it.
So if the batch file is run.bat, I have tried adding the line
ECHO %1 %2 %3 %4 %5 %6 %7 %8 %9 >> run.log
Which just echoes the parameters and the string >> run.log.
I suspect you have an unclosed quote somewhere in your parameter list (e.g.
foo.cmd "barwould cause that behaviour). You can likely solve this by putting the redirection in front of theecho(yes, this works):