I have a Windows batch file that process a bunch of files. As part of this I use the following line:
forfiles /p "%~dpn1%LogDir%" /m "%SupportLog%*" /c "cmd /c logreader.py @file > \"%~dpn1%ParsedLogDir%\@file_Logreader.txt\"
This works OK, but essentially loops through all my files (%SupportLog%*) and passes each one by one into the "logreader.py" script.
What I really want to do is create a list or parameter of all these files and pass all of them at once into the Python script, such the the command that should be run would resemble:
logreader.py "logfile.log" "logfile.log.1" "logfile.log.3" .....
I tried to use the SET command within the forfile command such that:
forfiles /p "%~dpn1%LogDir%" /m "%SupportLog%*" /c "cmd /c set PARAMS=%PARAMS%@file "
However, when run this and leave the ECHO ON, I see:
forfiles /p "C:\Path\log" /m "logfile.log*" /c "cmd /c set PARAMS=@file "
Which is incorrect. And when I "echo %PARAMS%", I get no result.
Is there a way of achieving this?