Need help with this IM batch command

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
projapati
Posts: 6
Joined: 2011-07-31T00:47:27-07:00
Authentication code: 8675308

Need help with this IM batch command

Post by projapati »

How do I loop all the files in a given folder and then resize all images to 300x300?
I need some clue on how to do this in windows batch script.

This is my cmd.bat:
FOR EACH %%a in (*.jpg) DO convert.exe %%a -resize 640x640 C:\Temp\Destination\%%~na.jpg

This is how I am trying to call it:
cmd.bat c:\temp\images

But it is not writing anything to C:\Temp\Destination\
Thanks
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Need help with this IM batch command

Post by anthony »

Do not use c: in the template. IM considers it to be a image format codec, not a Dos Drive.

Instead just use \Temp\Destination\%%~na.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply