How to Optimize JPEG & PNG Images Using jpegtran & OptiPNG in Windows

You may also like...

9 Responses

  1. Maxime says:

    Hi,
    how can i change the outfile directory with this batch, because if i do something like :

    forfiles /s /m *.jpg /c “cmd /c @\”C:\Program Files\Image Optimization\jpegtran.exe\” -copy none -optimize -progressive -outfile C:\path\to\my\output\directory\@file @file”

    This is not working …

    Thanks for your help !

    • Try surrounding the output file path with double quotes like so:

      forfiles /s /m *.jpg /c "cmd /c @\"C:\Program Files\Image Optimization\jpegtran.exe\" -copy none -optimize -progressive -outfile \"C:\path\to\my\output\directory\\@file\" @file"
  2. shrinivas says:

    Hello,

    I get the following error –

    ERROR: Invalid argument/option – ‘*.jpeg’

    any idea what am I doing wrong?

    Shrinivas

  3. Paul McCollam says:

    Thanks for the tutorial!

    However, I’m getting an error:
    “‘forfiles’ is not recognized as an internal or external command, operable program or batch file.”

    Any ideas?

    Windows 7 64 bit

Leave a Reply

Your email address will not be published. Required fields are marked *