I'm trying to write a simple batch script to use identify (from ImageMagick) to check dimensions of files in this directory and decide its orientation. Later, I'll be adding moving them to seperate folders. The problem is it can't enter the for loop.
setlocal enabledelayedexpansion
@echo off
for /r %%F in (*.) do (
identify -format "%%w" %%F > temp.txt
set /P temps=<temp.txt
set /A w=%temps%
identify -format "%%h" %%F > temp.txt
set /P temps=<temp.txt
set /A h=%temps%
if /I "%w%" GEQ "%h%" echo Is Landscape
if /I "%w%" LEQ "%h%" echo Is Vertical
pause
)
pause