I can get image size with this code if I run direct cmd:
identify -format "%wx%h" E:\Image.jpg (the result = 640x480)
However, if I put this code in a bat file,
@echo off identify -format "%wx%h" E:\Image.jpg it doesn't work. so, (the result = h) ??
How can I do this. Thanks...
%wx%as a (probably not defined) variable and replaces it with its value (probably nothing). The command line parser is slightly different: it keeps the literal%xw%when the variable is not defined. In a batch script. double the%to%%to escape them (treat them as a literal%):identify -format "%%wx%%h" E:\Image.jpg