Hello again Snibgo,
Can you help with a last modification to my batch script?
Code: Select all
identify %1
identify -format "%%[fx:w>400]" %1
FOR /R %%a in (*.bmp) ^
DO FOR /F "usebackq" %%D ^
IN (`identify -format "%%[fx:w>400]" %%a`) ^
DO if %%D==1 mogrify "%%~fa" -resize 50%% %%a
The above works fine with folder and subfolder names not containing space but once there is a space it does not.
I get the following errors:
C:\imgs\test2>FOR /F "usebackq" %D IN (`identify -format "%[fx:w>400]" C:\imgs\test2\New folder\test3.bmp`) DO if %D == 1 mogrify "C:\imgs\test2\New folder\test3.bmp" -resize 50% C:\imgs\test2\New folder\test3.bmp
identify.exe: unable to open image `C:\imgs\test2\New': No such file or directory @ error/blob.c/OpenBlob/2643.
identify.exe: no decode delegate for this image format `C:\imgs\test2\New' @ error/constitute.c/ReadImage/555.
identify.exe: unable to open image `folder\test3.bmp': No such file or directory @ error/blob.c/OpenBlob/2643.
Would you know how to handle the folder name with spaces.
Thanks