I began answering this question to say "Sorry, but no." To my surprise, though, you can! It's not very pretty, or efficient, but you can do it.
Storing the normal arguments to
program.exe in a variable is simple. This works (which is just your example, without redirection):
SET MYARGS=-parameter1 -parameter2 -parameter3
program.exe file1.txt %MYARGS%
Redirection, though, is not handled as arguments to the program, but as directives to the shell. It happens before variable setting or expansion, so including the
>> output.log suffix writes output to the log file immediately.
To get this to work, you have to escape the command string, and start a new process for each invocation of your program.
SET MYARGS=-parameter1 -parameter2 -parameter3 -parameter4 ^^^>^^^> output.log
CMD.EXE /C program.exe file1.txt %MYARGS%
CMD.EXE /C program.exe file2.txt %MYARGS%
Of course, if the name or location of your logfile ever needs to change, this way makes it a little cleaner:
SET TOLOG=^^^>^^^> %LOGFILE%
SET MYCMD=-parameter1 -parameter2 -parameter3 -parameter4
CMD.EXE /C program.exe file1.txt %MYARGS% %TOLOG%
CMD.EXE /C program.exe file2.txt %MYARGS% %TOLOG%
Spinning up a whole command interpreter for each call is a little heavy, but maybe that's OK for your situation. If you try it, I'd be interested to see how it affects your run times.
NOTE: This trick has at least one other possible trap. Variables you set in the batch file won't be available in the CMD shells you invoke. You can force them to be, but that's more code, and didn't look necessary for what you're doing.
See Hidden features of Windows batch files for the
^ escaping trick, and lots more.