** Moved this from another thread: viewtopic.php?f=1&t=15778&p=56606#p56606
For some reason I always seem to have problems getting the "identify" command to parse correctly within a DOS batch file.

The latest problem I am having is that when using identify (in a batch file) to retrieve IPTC info from an image, the identify only seems to bring back characters up to the first blank character.
For example, if the image contains the following text in the [2:05] tag: "Tents for Paddies"
...then the following command executed at the command prompt:
correctly returns: "Tents for Paddies"identify -format "%[IPTC:2:05]" test.jpg
However, when incorporated into a batch file like so:
it only returns: "Tents"for /f %%i in ('identify -format "p_caption=%%[IPTC:2:05]" test.jpg') do SET %%i
REM verification
for %%d in (p_caption) do ( echo %%d is !%%d! )
This happens for any tags containing blanks ... eg. [2:25] Keywords; [2:80] By-Line
For reference info on the tags see: http://www.imagemagick.org/script/escape.php .. the section under %[IPTC:dataset:record]
Any ideas???