Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have run into an issue using GIMP's batch processing.

I have a lot of files spred over a directory tree which need to be processed by a script-fu. I tried to generate a batch file which calls my script for each of theses, but windows complains about the command line being to long.

Here is what my batch file looks like:

@echo off
gimp -d -i -b --verbose "(myscriptName \"path\\to\\file.png\") -b "(myscriptName \"other\\path\to\\file2.png\") [...]

continuing like this for about 360 files more.

Is there way to have gimp process my files without having to call gimp individually for each and all of them?

share|improve this question
read what he explained above, so you will see that he has more than 20 + (49 x 362) = 17,758 characters. – kokbira Apr 26 '11 at 14:35
up vote 4 down vote accepted

Use PowerShell, or bash within Cygwin, or some other more powerful command shell than Windows' default CMD.EXE. These will let you iterate over multiple files on multiple lines (for instance by having the file names in a text file), eliminating this problem.

share|improve this answer
well, you can also give all commands through a file using Windows cmd. just do gimp < parameters.txt . there are another ways with pipe... – kokbira Apr 26 '11 at 14:31
@kokbira, fair enough. I haven't worked with Windows batch files in any meaningful way for probably 15 years. – CarlF Apr 26 '11 at 14:40

If you are using a Windows batch file, use the FOR command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.