Page 1 of 1

Need help with this IM batch command

Posted: 2011-08-01T23:54:02-07:00
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

Re: Need help with this IM batch command

Posted: 2011-08-02T06:34:00-07:00
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