Windows: Batch processing images with GIMP and saving them to new files

Solution 1:

The solution had two parts:

Part 1: The syntax of the batch command was wrong, especially the quotes need to be set correctly:

for %%x in (*.png) do "C:\Program files\GIMP\bin\gimp-2.8" -i -b "(script-fu-functionname \"%%x\"

Parts 2: Gimp always waiting for me to "press any key" was due to the wrong binary used: Instead of gimp-2.8, gimp-console-2.8 must be used.

Thanks, Karan, for hinting at the solutions.