Code: Select all
for /F "usebackq delims=" %%i in (`dir /b %1\*.%srcExt%`) do (
echo Processing file: "%%~nxi"
convert "%%~nxi" "%%~ni.%tgtExt%" )
But how do you separate the parenthesis used as an argument to a "convert" command with the end-bracket needed by the window batch script "FOR" command?
However I checked with Wolfgang Hugemann, the author of the 'Windows Guide' in IM Examples, and he said the better way of doing a recursive sub-directory run was to
use "FOR /R" rather than getting for to process the output of a "dir" command.
See Windows Usage, IM Examples
Batch processing a (sub-)dirctory tree
http://www.imagemagick.org/Usage/windows/#for_recursive
Wolfgang is currently not available, so it may be some time before the parenthesis command grouping for the "FOR" loop can be updated, to remove the need for separate ".bat" files.
I'll make a note of this however for his review when he returns.